codeacrobat has asked for the wisdom of the Perl Monks concerning the following question:
The reverse operation latin1 to utf8 is a quicky. It can be as short as:# utf8 -> latin1 encoding cat utf8.txt |perl -MEncode=from_to -pe 'from_to($_,"utf8","latin1");'
echo Döner | perl -C6 -pe1I believe that Perl v5.6 had a short way to convert the encodings.
Is there a short way in Perl > v5.6?tr/\0-\xFF//CU; # change Latin-1 to Unicode tr/\0-\x{FF}//UC; # change Unicode to Latin-1
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: quick translate utf8 to latin1 encoding
by almut (Canon) on Feb 15, 2007 at 20:59 UTC | |
by ikegami (Patriarch) on Feb 16, 2007 at 01:43 UTC | |
|
Re: quick translate utf8 to latin1 encoding
by codeacrobat (Chaplain) on Feb 15, 2007 at 23:34 UTC | |
by Joost (Canon) on Feb 15, 2007 at 23:46 UTC |