Subject: | utf8::is_utf8 on decoded json confusion |
Hi,
This may or may not be a bug, but I am a little confused.
take the following snippet
#!/bin/perl
use JSON;
use Data::Dumper;
use Encode;
$string = "{\"language\": \"fran\x{c3}\x{a7}ais\"}";
my $json = JSON->new->utf8(1);
my $ref = $json->decode($string);
print Dumper $ref;
$language = $ref->{'language'};
print "Encode::_is_utf8 says true\n" if utf8::is_utf8($language);
the output is
$VAR1 = {
'language' => "fran\x{e7}ais"
};
Encode::_is_utf8 says true
as the documentation says the returned string is unicode not utf8 so
should the flag be set in this case?
running libjson-perl 2.17 and perl v5.10.1