Lines Matching defs:Encode
2 # $Id: Encode.pm,v 3.21 2024/02/25 22:17:32 dankogai Exp $
4 package Encode;
18 our @CARP_NOT = qw(Encode::Encoder);
53 use Encode::Alias ();
54 use Encode::MIME::Name;
61 require Encode::Config;
70 require Encode::ConfigLocal;
81 for my $mod ( map { m/::/ ? $_ : "Encode::$_" } @_ ) {
109 push @Encode::CARP_NOT, $class unless grep { $_ eq $class } @Encode::CARP_NOT;
110 push @Encode::Encoding::CARP_NOT, $class unless grep { $_ eq $class } @Encode::Encoding::CARP_NOT;
142 # HACK: These two functions must be defined in Encode and because of
143 # cyclic dependency between Encode and Encode::Alias, Exporter does not work
145 goto &Encode::Alias::find_alias;
148 goto &Encode::Alias::define_alias;
158 my $name = Encode::MIME::Name::get_encode_name( $mime_name );
177 package Encode::UTF_EBCDIC;
178 use parent 'Encode::Encoding';
179 my $obj = bless { Name => "UTF_EBCDIC" } => "Encode::UTF_EBCDIC";
180 Encode::define_encoding($obj, 'Unicode');
209 package Encode::XS;
210 use parent 'Encode::Encoding';
214 package Encode::utf8;
215 use parent 'Encode::Encoding';
222 Encode::define_encoding( $obj{$_} => $_ );
248 Encode - character encodings in Perl
252 use Encode qw(decode encode);
253 $characters = decode('UTF-8', $octets, Encode::FB_CROAK);
254 $octets = encode('UTF-8', $characters, Encode::FB_CROAK);
258 Encode consists of a collection of modules whose details are too extensive
265 =item L<Encode::Alias> - Alias definitions to encodings
267 =item L<Encode::Encoding> - Encode Implementation Base Class
269 =item L<Encode::Supported> - List of Supported Encodings
271 =item L<Encode::CN> - Simplified Chinese Encodings
273 =item L<Encode::JP> - Japanese Encodings
275 =item L<Encode::KR> - Korean Encodings
277 =item L<Encode::TW> - Traditional Chinese Encodings
283 The C<Encode> module provides the interface between Perl strings
423 See L<Encode::Encoding> for details.
522 use Encode;
523 @list = Encode->encodings();
529 @all_encodings = Encode->encodings(":all");
533 @with_jp = Encode->encodings("Encode::JP");
535 When "C<::>" is not in the name, "C<Encode::>" is assumed.
537 @ebcdic = Encode->encodings("EBCDIC");
540 see L<Encode::Supported>.
546 use Encode;
547 use Encode::Alias;
558 Encode::resolve_alias("latin1") eq "iso-8859-1" # true
559 Encode::resolve_alias("iso-8859-12") # false; nonexistent
560 Encode::resolve_alias($name) eq $name # true if $name is canonical
562 C<resolve_alias()> does not need C<use Encode::Alias>; it can be
563 imported via C<use Encode qw(resolve_alias)>.
565 See L<Encode::Alias> for details.
574 As of C<Encode> version 2.21, a new method C<mime_name()> is therefore added.
576 use Encode;
581 See also: L<Encode::Encoding>
621 Encode::perlio_ok("hz"); # false
624 use Encode qw(perlio_ok); # imported upon request
627 Fortunately, all encodings that come with C<Encode> core are C<PerlIO>-savvy
629 L<Encode::Encoding> and L<Encode::PerlIO>.
633 The optional I<CHECK> argument tells C<Encode> what to do when
634 encountering malformed data. Without I<CHECK>, C<Encode::FB_DEFAULT>
637 As of version 2.12, C<Encode> supports coderef values for C<CHECK>;
642 L<Encode::Unicode> ignores I<CHECK> and it always croaks on error.
648 CHECK = Encode::FB_DEFAULT ( == 0)
658 CHECK = Encode::FB_CROAK ( == 1)
666 CHECK = Encode::FB_QUIET
668 If I<CHECK> is set to C<Encode::FB_QUIET>, encoding and decoding immediately
679 $string .= decode($encoding, $buffer, Encode::FB_QUIET);
685 CHECK = Encode::FB_WARN
690 B<CAVEAT>: All warnings from Encode module are reported, independently of
694 since Encode version 2.99.
700 =item perlqq mode (I<CHECK> = Encode::FB_PERLQQ)
702 =item HTML charref mode (I<CHECK> = Encode::FB_HTMLCREF)
704 =item XML charref mode (I<CHECK> = Encode::FB_XMLCREF)
708 For encodings that are implemented by the C<Encode::XS> module, C<CHECK> C<==>
709 C<Encode::FB_PERLQQ> puts C<encode> and C<decode> into C<perlqq> fallback mode.
721 In C<Encode> 2.10 or later, C<LEAVE_SRC> is also implied.
727 C<use Encode qw(:fallbacks)>, and you can import the generic bitmask
728 constants via C<use Encode qw(:fallback_all)>.
741 Encode::LEAVE_SRC
743 If the C<Encode::LEAVE_SRC> bit is I<not> set but I<CHECK> is set, then the
749 As of C<Encode> 2.12, C<CHECK> can also be a code reference which takes the
771 use Encode qw(define_encoding);
775 should provide the interface described in L<Encode::Encoding>.
779 See L<Encode::Encoding> for details.
895 Subject: Re: Make Encode.pm support the real UTF-8
914 lax. C<Encode> version 2.10 or later thus groks this subtle but critically
934 In the C<Encode> module, C<"UTF-8"> is actually a canonical name for
936 critical; without it, C<Encode> goes "liberal" and (perhaps overly-)permissive:
948 L<Encode::Encoding>,
949 L<Encode::Supported>,
950 L<Encode::PerlIO>,