Created
March 17, 2017 09:42
-
-
Save ifduyue/6b54446196e1bedf45ea33d82eba46f7 to your computer and use it in GitHub Desktop.
Confused with perl5 utf8 json
This file contains hidden or 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
"苦" 34:33510:34 | |
"è¦" 34:232:139:166:34 | |
Wide character in say at -e line 1. | |
"苦" 34:33510:34 | |
"苦" 34:232:139:166:34 | |
"苦" 34:232:139:166:34 | |
"è¦" 34:195:168:194:139:194:166:34 | |
"è¦" 34:232:139:166:34 | |
"è¦" 34:195:168:194:139:194:166:34 |
This file contains hidden or 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
#!/bin/bash | |
perl -Mfeature=say -MJSON -Mutf8 -CS -e 'my $json = JSON->new->allow_nonref ->encode("苦"); say $json, "\t", join ":", map { ord } split //, $json' | |
perl -Mfeature=say -MJSON -Mutf8 -CS -e 'my $json = JSON->new->allow_nonref->utf8->encode("苦"); say $json, "\t", join ":", map { ord } split //, $json' | |
perl -Mfeature=say -MJSON -Mutf8 -e 'my $json = JSON->new->allow_nonref ->encode("苦"); say $json, "\t", join ":", map { ord } split //, $json' | |
perl -Mfeature=say -MJSON -Mutf8 -e 'my $json = JSON->new->allow_nonref->utf8->encode("苦"); say $json, "\t", join ":", map { ord } split //, $json' | |
perl -Mfeature=say -MJSON -e 'my $json = JSON->new->allow_nonref ->encode("苦"); say $json, "\t", join ":", map { ord } split //, $json' | |
perl -Mfeature=say -MJSON -e 'my $json = JSON->new->allow_nonref->utf8->encode("苦"); say $json, "\t", join ":", map { ord } split //, $json' | |
perl -Mfeature=say -MJSON -CS -e 'my $json = JSON->new->allow_nonref ->encode("苦"); say $json, "\t", join ":", map { ord } split //, $json' | |
perl -Mfeature=say -MJSON -CS -e 'my $json = JSON->new->allow_nonref->utf8->encode("苦"); say $json, "\t", join ":", map { ord } split //, $json' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment