in reply to Re^2: JSON character encoding
in thread JSON character encoding

Yes, both of those are just UTF-8. The trick is to put them in a form that your output device can handle. If you're in a terminal window, it might not to be able to display weird unicode characters like smileys. You might try something like this:
use Encode qw( encode FB_HTMLCREF ); print encode('ascii', $jsonstuff->{items}[0]{snippet}{description}, FB +_HTMLCREF), "\n";
You'll get "It’s" and "moment 😊", which are ugly, but should come out right if you put them in an html file.

Replies are listed 'Best First'.
Re^4: JSON character encoding
by Bman70 (Acolyte) on May 29, 2017 at 21:41 UTC
    IT WORKED! Now all the little smileys, arrows, etc. show up in my final HTML output. Much thanks for the tip. I just put my final html content file through your encode process before outputting to web:
    $pagecontent = encode('ascii', $pagecontent, FB_HTMLCREF);

    p.s. for anyone reading this later: If you store your JSON data in a file, then you need to access it explicitly as utf8:
    open(my $fh, '<:utf8', $filename)
    I had to do this and use Anonymous Monk's FB_HTMLCREF process to finally get the emoticons to show.