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

Re: special characters in parsed json rendering badly in browser

by Corion (Patriarch)
on Sep 03, 2018 at 08:02 UTC ( [id://1221606]=note: print w/replies, xml ) Need Help??


in reply to special characters in parsed json rendering badly in browser

According to JSON, JSON::decode_json expects raw octets. Also, it returns already UTF-8 decoded content, so your additional decode step should not be necessary.

Have you looked at the octets you download and have you verified that your problem is not in the further treatment or output of the data?

Personally, I find it helpful to look at hexdumps of the octets to verify that the proper data is written to the console.

I see that nowhere in the example code you binmode STDOUT, <c>':encoding(UTF-8)', maybe that would be a good step?

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (2)
As of 2024-04-26 05:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found