Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

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

by ikegami (Pope)
on Sep 07, 2014 at 03:18 UTC ( #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
Node Status?
node history
Node Type: note [id://1099786]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (3)
As of 2021-02-27 04:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?