From: "Gunnar Hjalmarsson" <[EMAIL PROTECTED]>
This is the approach I had in mind:
$ cat test.pl
#!/usr/bin/perl
use Encode;
$octets = <DATA>;
$chars = decode 'utf8', $octets;
%special = ( "\xc3\x96" => 'O', "\xc3\xa5" => 'a' );
($translated = $octets) =~ s/(\xc3\x96|\xc3\xa5)/$special{$1}/g;
printf '%-28s%s', 'Raw data (utf8 encoded): ', $octets;
printf '%-28s%s', 'Readable characters: ', $chars;
printf '%-28s%s', 'Translated characters: ', $translated;
I am thinking to do something like:
$text =~
tr/oiaeuüäéö¦EÁëÍÚÝÖíµcÉeçôËÄúÓßCýuonÜóáeEÔOyg»r§a«NÇdRrNEškCuUUDsnAOnc/oiaeuuaeo|EAeIUYOiueEicoEAuOBEyuooUoaeIOOyg>aSa<OCiAoNEskCuUUISnAOnc/;
...because it requires less code.
Octavian
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/