Encode::Escape

Perl extension for Encodings of various escape sequences
Download

Encode::Escape Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • You Hyun Jo
  • Publisher web site:
  • http://search.cpan.org/~you/

Encode::Escape Tags


Encode::Escape Description

Perl extension for Encodings of various escape sequences Encode::Escape is a Perl module that acts as a wrapper class for encodings of escape sequences.It is NOT for an escape-based encoding (eg. ISO-2022-JP). It is for encoding/decoding escape sequences, generally used in source codes.Many programming languages, markup languages, and typesetting languages provide methods for encoding special (or functional) characters and non-keyboard symbols in the form of escape sequence. That's what I concern.Yes, you're right. There already exist many modules. See String::Escape, Unicode::Escape, TeX::Encode, HTML::Mason::Escape, Template::Plugin::XML::Escape, URI::Escape, etc.But for some reason I need to do it in a different way. There is more than one way to do it! After that, I asked myself if this module is useful. May be not except for me. At this time, Zhuangzi reminds me, ""The useless has its use"".SYNOPSIS use Encode::Escape; $escaped_ascii = "Perl\\tPathologically Eclectic Rubbish Lister\\n"; $ascii = decode 'ascii-escape', $escaped_ascii; # Now, $ascii is equivalent to # double quote string "Perl\tPathologically Eclectic Rubbish Lister\n" $escaped_unicode = "Perl \\x{041F}\\x{0435}\\x{0440}\\x{043B} \\x{D384}" $string = decode 'unicode-escape', $escaped_unicode; # Now, $string is equvialent to # double quote string "Perl \x{041F}\x{0435}\x{0440}\x{043B} \x{D384}" It may looks non-sense. Here's another case.If you have a text data file 'ascii-escape.txt'. It contains a line: Perl\tPathologically Eclectic Rubbish Lister\nAnd you want to use it as if it were a normal double quote string in source code. Try this: open(FILE, 'ascii-escape.txt'); while() { chomp; print decode 'ascii-escape', $_; } Requirements: · Perl


Encode::Escape Related Software