"Fossies" - the Fresh Open Source Software Archive

Member "install-tl-20200916/tlpkg/tlperl/lib/PerlIO/encoding.pm" (7 Mar 2020, 1250 Bytes) of package /windows/misc/install-tl.zip:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Perl source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

    1 package PerlIO::encoding;
    2 
    3 use strict;
    4 our $VERSION = '0.27';
    5 our $DEBUG = 0;
    6 $DEBUG and warn __PACKAGE__, " called by ", join(", ", caller), "\n";
    7 
    8 #
    9 # Equivalent of this is done in encoding.xs - do not uncomment.
   10 #
   11 # use Encode ();
   12 
   13 require XSLoader;
   14 XSLoader::load();
   15 
   16 our $fallback =
   17     Encode::PERLQQ()|Encode::WARN_ON_ERR()|Encode::ONLY_PRAGMA_WARNINGS()|Encode::STOP_AT_PARTIAL();
   18 
   19 1;
   20 __END__
   21 
   22 =head1 NAME
   23 
   24 PerlIO::encoding - encoding layer
   25 
   26 =head1 SYNOPSIS
   27 
   28   use PerlIO::encoding;
   29 
   30   open($f, "<:encoding(foo)", "infoo");
   31   open($f, ">:encoding(bar)", "outbar");
   32 
   33   use Encode qw(:fallbacks);
   34   $PerlIO::encoding::fallback = FB_PERLQQ;
   35 
   36 =head1 DESCRIPTION
   37 
   38 This PerlIO layer opens a filehandle with a transparent encoding filter.
   39 
   40 On input, it converts the bytes expected to be in the specified
   41 character set and encoding to Perl string data (Unicode and
   42 Perl's internal Unicode encoding, UTF-8).  On output, it converts
   43 Perl string data into the specified character set and encoding.
   44 
   45 When the layer is pushed, the current value of C<$PerlIO::encoding::fallback>
   46 is saved and used as the CHECK argument when calling the Encode methods
   47 encode() and decode().
   48 
   49 =head1 SEE ALSO
   50 
   51 L<open>, L<Encode>, L<perlfunc/binmode>, L<perluniintro>
   52 
   53 =cut