Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: special characters in parsed json rendering badly in browser

by Anonymous Monk
on Sep 02, 2018 at 03:18 UTC ( #1221560=note: print w/replies, xml ) Need Help??


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

Try decoding it with Encode:
use Encode; $event{'desc'} = Encode::decode(utf8 => $decoded->{'description'});
You mention a browser so be sure to specify the charset:
Content-type: text/html; charset=utf-8

Replies are listed 'Best First'.
Re^2: special characters in parsed json rendering badly in browser
by slugger415 (Monk) on Sep 02, 2018 at 19:49 UTC

    result of Encode:

    Wide character at C:/Strawberry/perl/lib/Encode.pm line 228.

    And the script stops there.

Re^2: special characters in parsed json rendering badly in browser
by slugger415 (Monk) on Sep 02, 2018 at 19:58 UTC

    charset in Firefox Windows iso-8859-1

    not sure where that gets specified

      Is the browser showing the contents of a file or the response from a web server ?

      poj

        Contents of the file, I'm just opening it locally.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (3)
As of 2020-04-03 06:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    The most amusing oxymoron is:
















    Results (26 votes). Check out past polls.

    Notices?