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