encoding

Allows you to write your script in non-ascii or non-utf8.
Download

encoding Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Dan Kogai
  • Publisher web site:
  • http://search.cpan.org/~oyama/Crypt-Camellia-2.01/lib/Crypt/Camellia.pm

encoding Tags


encoding Description

Allows you to write your script in non-ascii or non-utf8. encoding is a Perl module that allows you to write your script in non-ascii or non-utf8.SYNOPSIS use encoding "greek"; # Perl like Greek to you? use encoding "euc-jp"; # Jperl! # or you can even do this if your shell supports your native encoding perl -Mencoding=latin2 -e '...' # Feeling centrally European? perl -Mencoding=euc-kr -e '...' # Or Korean? # more control # A simple euc-cn => utf-8 converter use encoding "euc-cn", STDOUT => "utf8"; while(){print}; # "no encoding;" supported (but not scoped!) no encoding; # an alternate way, Filter use encoding "euc-jp", Filter=>1; # now you can use kanji identifiers -- in euc-jp! # switch on locale - # note that this probably means that unless you have a complete control # over the environments the application is ever going to be run, you should # NOT use the feature of encoding pragma allowing you to write your script # in any recognized encoding because changing locale settings will wreck # the script; you can of course still use the other features of the pragma. use encoding ':locale';ABSTRACTLet's start with a bit of history: Perl 5.6.0 introduced Unicode support. You could apply substr() and regexes even to complex CJK characters -- so long as the script was written in UTF-8. But back then, text editors that supported UTF-8 were still rare and many users instead chose to write scripts in legacy encodings, giving up a whole new feature of Perl 5.6.Rewind to the future: starting from perl 5.8.0 with the encoding pragma, you can write your script in any encoding you like (so long as the Encode module supports it) and still enjoy Unicode support. This pragma achieves that by doing the following: * Internally converts all literals (q//,qq//,qr//,qw///, qx//) from the encoding specified to utf8. In Perl 5.8.1 and later, literals in tr/// and DATA pseudo-filehandle are also converted. * Changing PerlIO layers of STDIN and STDOUT to the encoding specified. Requirements: · Perl


encoding Related Software