Created
April 4, 2018 15:44
-
-
Save imyaman/7953bd89dd7cc16aa3925ac864aba57f to your computer and use it in GitHub Desktop.
perl json decode
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
use strict; | |
use warnings; | |
use JSON (decode_json); | |
use Data::Dumper; | |
use utf8; | |
$content = qq/ {"Name":"Sangyong Gwak","성명":"곽상용"} /; | |
print $content; | |
print "\n" . " ---- ---- ---- ----" . "\n"; | |
#my $perl_hash=decode('UTF-8', $content); | |
#my $perl_hash = decode_json($content); | |
my $perl_hash = JSON->new->utf8->decode($content); | |
print Dumper $perl_hash; | |
exit; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment