in reply to JSON::XS produces valid utf-8, and JSON doesn't - why?
Some remarks:
my $ok = utf8::decode($json); is not the best way to validate utf8. Because:output:use feature 'say'; binmode STDOUT, 'encoding(utf-8)'; my $str = "\xFC\x90\x80\x80\x80\x80"; my $ok = utf8::decode( $str ); say $ok ? 'ok' : 'not ok'; say $str;
ok Code point 0x10000000 is not Unicode, may not be portable at demo.pl l +ine 8. "\x{10000000}" does not map to utf8 at demo.pl line 8. \x{10000000}
is not super usefulmy $ok = utf8::decode($json); Dump( $json );
|
|---|