1 package PerlIO::encoding;
5 $DEBUG and warn __PACKAGE__, " called by ", join(", ", caller), "\n";
8 # Equivalent of this is done in encoding.xs - do not uncomment.
13 XSLoader::load(__PACKAGE__, $VERSION);
15 our $fallback = Encode::PERLQQ()|Encode::WARN_ON_ERR();
22 PerlIO::encoding - encoding layer
26 open($f, "<:encoding(foo)", "infoo");
27 open($f, ">:encoding(bar)", "outbar");
29 use Encode qw(:fallbacks);
30 $PerlIO::encoding::check = FB_PERLQQ;
34 Open a filehandle with a transparent encoding filter.
36 On input, convert the bytes expected to be in the specified
37 character set and encoding to Perl string data (Unicode and
38 Perl's internal Unicode encoding, UTF-8). On output, convert
39 Perl string data into the specified character set and encoding.
41 When the layer is pushed the current value of C<$PerlIO::encoding::check>
42 is saved and used as the check argument when calling the Encodings
47 L<open>, L<Encode>, L<perlfunc/binmode>, L<perluniintro>