in reply to Re^4: Strange behaviour ODBC/Unicode in perl
in thread Strange behaviour ODBC/Unicode in perl
Printing shouldn't cause any conversion
$ perl -MDevel::Peek -MEncode -we'$x=encode("UTF-8", chr(259)); Dump($ +x); print $x' | od -b SV = PV(0x819f9e0) at 0x814cc6c REFCNT = 1 FLAGS = (POK,pPOK) PV = 0x81698e0 "\304\203"\0 ---. CUR = 2 \__ same LEN = 3 / 0000000 304 203 --------------' 0000002 $ perl -MDevel::Peek -MEncode -we'$x=encode("UTF-8", chr(238)); Dump($ +x); print $x' | od -b SV = PV(0x819f9e0) at 0x814cc6c REFCNT = 1 FLAGS = (POK,pPOK) PV = 0x81698e0 "\303\256"\0 ---. CUR = 2 \__ same LEN = 3 / 0000000 303 256 --------------' 0000002
How do you know it's outputting xEE?
Are you using :encoding() on the STDOUT? You shouldn't with this data.
Are you using CGI's HTML generation methods (print h1(text))? They do some encoding too.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^6: Strange behaviour ODBC/Unicode in perl
by jpvdv (Initiate) on Feb 05, 2008 at 08:11 UTC | |
by ikegami (Patriarch) on Feb 05, 2008 at 08:44 UTC |