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