"Fossies" - the Fresh Open Source Software Archive

Member "install-tl-20200916/tlpkg/tlperl/site/lib/Encode/compat/5006001.pm" (5 Apr 2016, 583 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 # $File: //member/autrijus/Encode-compat/lib/Encode/compat/5006001.pm $ $Author: autrijus $
    2 # $Revision: #3 $ $Change: 2534 $ $DateTime: 2002/12/02 00:33:16 $
    3 
    4 package Encode::compat::5006001;
    5 our $VERSION = '0.05';
    6 
    7 1;
    8 
    9 package Encode;
   10 
   11 use strict;
   12 use base 'Exporter';
   13 no warnings 'redefine';
   14 
   15 sub _utf8_on {
   16     $_[0] = pack('U*', unpack('U0U*', $_[0]))
   17 }
   18 
   19 sub _utf8_off {
   20     $_[0] = pack('C*', unpack('C*', $_[0]))
   21 }
   22 
   23 sub is_utf8 {
   24     # XXX: got any better ideas?
   25     use utf8;
   26     foreach my $char (split(//, $_[0])) {
   27     return 1 if ord($char) > 255;
   28     }
   29     return 0;
   30 }
   31 
   32 1;