Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

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

by ikegami (Patriarch)
on Sep 07, 2014 at 03:18 UTC ( [id://1099786]=note: print w/replies, xml ) Need Help??


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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1099786]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (5)
As of 2024-04-25 14:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found