in reply to Re: quick translate utf8 to latin1 encoding
in thread quick translate utf8 to latin1 encoding

It works fine for characters in the native charset...

# feeder.pl $s = join '', map chr, 0..255; print $s;
# tester.pl $s = join '', map chr, 0..255; 1 while $read = read(STDIN, $in, 512, $ofs+=$read); print($in eq $s ? "pass\n" : "fail\n");
$ perl feeder.pl | perl tester.pl pass $ perl feeder.pl | perl -C6 -pe1 | perl -C1 -pe1 | perl tester.pl pass

... But it doesn't work so well for characters not in the native charset.

$ perl -C6 -e 'print "\x{2660}"' | perl -C1 -pe1 Wide character in print, <> line 1. [junk][junk][junk]

Compare to

$ perl -C6 -e 'print "\x{2660}"' | perl -C1 -MEncode -pe '$_=encode("i +so-latin-1",$_);' ?

Up to the reader to choose if that's good enough.