1 package PerlIO::encoding;
6 $DEBUG and warn __PACKAGE__, " called by ", join(", ", caller), "\n";
9 # Equivalent of this is done in encoding.xs - do not uncomment.
14 XSLoader::load(__PACKAGE__, $VERSION);
17 Encode::PERLQQ()|Encode::WARN_ON_ERR()|Encode::STOP_AT_PARTIAL();
24 PerlIO::encoding - encoding layer
30 open($f, "<:encoding(foo)", "infoo");
31 open($f, ">:encoding(bar)", "outbar");
33 use Encode qw(:fallbacks);
34 $PerlIO::encoding::fallback = FB_PERLQQ;
38 This PerlIO layer opens a filehandle with a transparent encoding filter.
40 On input, it converts the bytes expected to be in the specified
41 character set and encoding to Perl string data (Unicode and
42 Perl's internal Unicode encoding, UTF-8). On output, it converts
43 Perl string data into the specified character set and encoding.
45 When the layer is pushed, the current value of C<$PerlIO::encoding::fallback>
46 is saved and used as the CHECK argument when calling the Encode methods
47 encode() and decode().
51 L<open>, L<Encode>, L<perlfunc/binmode>, L<perluniintro>