Commit | Line | Data |
59035dcc |
1 | package PerlIO::encoding; |
20de0cb2 |
2 | our $VERSION = '0.03'; |
59035dcc |
3 | use XSLoader (); |
20de0cb2 |
4 | use Encode (); # Load but do not import anything. |
5 | our $check; |
59035dcc |
6 | XSLoader::load 'PerlIO::encoding'; |
7 | 1; |
8 | __END__ |
9 | |
10 | =head1 NAME |
11 | |
12 | PerlIO::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 |
24 | Open a filehandle with a transparent encoding filter. |
25 | |
26 | On input, convert the bytes expected to be in the specified |
27 | character set and encoding to Perl string data (Unicode and |
28 | Perl's internal Unicode encoding, UTF-8). On output, convert |
29 | Perl string data into the specified character set and encoding. |
30 | |
20de0cb2 |
31 | When the layer is pushed the current value of C<$PerlIO::encoding::check> |
32 | is saved and used as the check argument when calling the Encodings |
33 | encode and decode. |
34 | |
b89cebd3 |
35 | =head1 SEE ALSO |
36 | |
37 | L<open>, L<Encode>, L<perlfunc/binmode>, L<perluniintro> |
2dc05cb3 |
38 | |
59035dcc |
39 | =cut |
40 | |
41 | |