Integrate mainline into perlio
[p5sagit/p5-mst-13.2.git] / ext / PerlIO / encoding / encoding.pm
CommitLineData
59035dcc 1package PerlIO::encoding;
20de0cb2 2our $VERSION = '0.03';
59035dcc 3use XSLoader ();
20de0cb2 4use Encode (); # Load but do not import anything.
5our $check;
59035dcc 6XSLoader::load 'PerlIO::encoding';
71;
8__END__
9
10=head1 NAME
11
12PerlIO::encoding - encoding layer
13
14=head1 SYNOPSIS
15
b89cebd3 16 open($f, "<:encoding(foo)", "infoo");
17 open($f, ">:encoding(bar)", "outbar");
59035dcc 18
20de0cb2 19 use Encode;
20 $PerlIO::encoding::check = Encode::FB_PERLQQ();
21
59035dcc 22=head1 DESCRIPTION
23
b89cebd3 24Open a filehandle with a transparent encoding filter.
25
26On input, convert the bytes expected to be in the specified
27character set and encoding to Perl string data (Unicode and
28Perl's internal Unicode encoding, UTF-8). On output, convert
29Perl string data into the specified character set and encoding.
30
20de0cb2 31When the layer is pushed the current value of C<$PerlIO::encoding::check>
32is saved and used as the check argument when calling the Encodings
33encode and decode.
34
b89cebd3 35=head1 SEE ALSO
36
37L<open>, L<Encode>, L<perlfunc/binmode>, L<perluniintro>
2dc05cb3 38
59035dcc 39=cut
40
41