Integrate mainline
[p5sagit/p5-mst-13.2.git] / ext / PerlIO / encoding / encoding.pm
CommitLineData
59035dcc 1package PerlIO::encoding;
c657f685 2use strict;
3our $VERSION = '0.04';
4our $DEBUG = 0;
5$DEBUG and warn __PACKAGE__, " called by ", join(", ", caller), "\n";
6
7#
8# Now these are all done in encoding.xs DO NOT COMMENT'em out!
9#
10# use Encode qw(:fallbacks);
11# our $check;
12
59035dcc 13use XSLoader ();
c657f685 14XSLoader::load(__PACKAGE__, $VERSION);
15
59035dcc 161;
17__END__
18
19=head1 NAME
20
21PerlIO::encoding - encoding layer
22
23=head1 SYNOPSIS
24
b89cebd3 25 open($f, "<:encoding(foo)", "infoo");
26 open($f, ">:encoding(bar)", "outbar");
59035dcc 27
c657f685 28 use Encode qw(:fallbacks);
29 $PerlIO::encoding::check = FB_PERLQQ;
c00aecee 30
59035dcc 31=head1 DESCRIPTION
32
b89cebd3 33Open a filehandle with a transparent encoding filter.
34
35On input, convert the bytes expected to be in the specified
36character set and encoding to Perl string data (Unicode and
37Perl's internal Unicode encoding, UTF-8). On output, convert
38Perl string data into the specified character set and encoding.
39
c00aecee 40When the layer is pushed the current value of C<$PerlIO::encoding::check>
41is saved and used as the check argument when calling the Encodings
42encode and decode.
43
b89cebd3 44=head1 SEE ALSO
45
46L<open>, L<Encode>, L<perlfunc/binmode>, L<perluniintro>
2dc05cb3 47
59035dcc 48=cut
49