Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: special characters in parsed json rendering badly in browser

by Anonymous Monk
on Sep 02, 2018 at 03:18 UTC ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1221560]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (2)
As of 2024-04-24 22:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found