Re: B::walkoptree segfaults
[p5sagit/p5-mst-13.2.git] / ext / PerlIO / encoding / encoding.pm
CommitLineData
59035dcc 1package PerlIO::encoding;
c657f685 2use strict;
47dd3999 3our $VERSION = '0.07';
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
dc54c799 15our $fallback = Encode::PERLQQ()|Encode::WARN_ON_ERR();
1982da40 16
59035dcc 171;
18__END__
19
20=head1 NAME
21
22PerlIO::encoding - encoding layer
23
24=head1 SYNOPSIS
25
b89cebd3 26 open($f, "<:encoding(foo)", "infoo");
27 open($f, ">:encoding(bar)", "outbar");
59035dcc 28
c657f685 29 use Encode qw(:fallbacks);
e7e5539a 30 $PerlIO::encoding::fallback = FB_PERLQQ;
c00aecee 31
59035dcc 32=head1 DESCRIPTION
33
b89cebd3 34Open a filehandle with a transparent encoding filter.
35
36On input, convert the bytes expected to be in the specified
37character set and encoding to Perl string data (Unicode and
38Perl's internal Unicode encoding, UTF-8). On output, convert
39Perl string data into the specified character set and encoding.
40
e7e5539a 41When the layer is pushed the current value of C<$PerlIO::encoding::fallback>
c00aecee 42is saved and used as the check argument when calling the Encodings
43encode and decode.
44
b89cebd3 45=head1 SEE ALSO
46
47L<open>, L<Encode>, L<perlfunc/binmode>, L<perluniintro>
2dc05cb3 48
59035dcc 49=cut
50