1PerlIO::encoding(3pm) Perl Programmers Reference Guide PerlIO::encoding(3pm)
2
3
4
6 PerlIO::encoding - encoding layer
7
9 use PerlIO::encoding;
10
11 open($f, "<:encoding(foo)", "infoo");
12 open($f, ">:encoding(bar)", "outbar");
13
14 use Encode qw(:fallbacks);
15 $PerlIO::encoding::fallback = FB_PERLQQ;
16
18 This PerlIO layer opens a filehandle with a transparent encoding
19 filter.
20
21 On input, it converts the bytes expected to be in the specified
22 character set and encoding to Perl string data (Unicode and Perl's
23 internal Unicode encoding, UTF-8). On output, it converts Perl string
24 data into the specified character set and encoding.
25
26 When the layer is pushed, the current value of
27 $PerlIO::encoding::fallback is saved and used as the CHECK argument
28 when calling the Encode methods encode() and decode().
29
31 open, Encode, "binmode" in perlfunc, perluniintro
32
33
34
35perl v5.32.1 2021-03-31 PerlIO::encoding(3pm)