in reply to Database vs XML output representation of two-byte UTF-8 character

It's the result of double encoding. You encoded an output twice, or you encoded an output based on an input you forgot to decode.

Looks like you are encoding your output using UTF-8, which is sensible if you were outputting text to a UTF-8 terminal, but you are outputting a raw HTTP response containing an XML document encoded using UTF-8.

  • Comment on Re: Database vs XML output representation of two-byte UTF-8 character

Replies are listed 'Best First'.
Re^2: Database vs XML output representation of two-byte UTF-8 character
by jkeenan1 (Deacon) on Sep 08, 2014 at 13:31 UTC

    ikegami, I believe your answer is correct. The terminal in question is the Mac OS X Terminal program with Preferences->Settings->Advanced->Character encoding: "Unicode (UTF-8)". I changed my debugging code to:

    diag(Encode::decode_utf8($res->content));
    ... and got the expected output in the Terminal (without affecting what was stored or retrieved from the database.

    Thank you very much.

    Jim Keenan