in reply to How to test different encoding
Excactly, perl changes the LATIN1 back to unicode because the output stream STDOUT is utf8 in your case.
What you would have to do to see funny characters is to change the output stream with :encoding(...). On my machine
> perl -e 'binmode STDOUT, ":encoding(iso-8859-1)"; print STDOUT "Hüsk +er Dü\n";' Hüsker Dü > perl -e 'binmode STDOUT, ":encoding(utf8)"; print STDOUT "Hüsker Dü\ +n";' H**sker D**
I changed the nearly unprintable characters to **. Actually I was surprised to find out my linux is still using latin1 on the shell (or my reasoning is wrong).
You can find out some more with 'man perlunicode' and 'man encode'
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How to test different encoding
by ait (Hermit) on Sep 16, 2008 at 19:06 UTC | |
by sunshine_august (Scribe) on Sep 18, 2008 at 02:54 UTC | |
by jethro (Monsignor) on Sep 22, 2008 at 15:12 UTC |