in reply to Re^2: UTF8/Unicode Confusion
in thread UTF8/Unicode Confusion
The problem must lie in how you're using the returned value. If for example you're just printing it to STDOUT, and if whatever's listening on STDOUT expects utf8 encoding (eg the terminal), then you need to let Perl know that any output on that file handle should be utf8 encoded, eg
see perluniintro (in 5.8.x) for more information.$ perl -e 'print chr 0xa5'|od -x 0000000 00a5 $ perl -e 'binmode(STDOUT, ":utf8"); print chr 0xa5'|od -x 0000000 a5c2 $
Dave.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: UTF8/Unicode Confusion
by jk2addict (Chaplain) on Mar 21, 2005 at 01:09 UTC | |
by ysth (Canon) on Mar 21, 2005 at 05:39 UTC | |
by jk2addict (Chaplain) on Mar 21, 2005 at 14:54 UTC | |
by ysth (Canon) on Mar 21, 2005 at 19:54 UTC |