You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have large JSON files to parse and JSON::SL seemed like the perfect package to do my task. However I noticed that not all unicode characters are being handled properly. Example:
#!/usr/bin/env perl
use 5.016; use warnings;
use utf8;
use JSON::SL;
use JSON;
binmode STDOUT, ':encoding(UTF-8)';
my $str = '{"key":["\u00af"]}';
open my $fh, '<', \$str;
my $data = decode_json($str);
say $_ for @{$data->{key}};
my $j = JSON::SL->new();
$j->set_jsonpointer(['/key/^']);
while( read $fh, my $buf, 1024 ) {
$j->feed($buf);
while (my $obj = $j->fetch) {
my $val = $obj->{Value};
say $val;
}
}
$ perl test.pl
¯
"\x{00af}" does not map to utf8 at test.pl line 22.
\xAF
JSON seems to recognize the character, while JSON::SL does not.
The text was updated successfully, but these errors were encountered:
I have large JSON files to parse and JSON::SL seemed like the perfect package to do my task. However I noticed that not all unicode characters are being handled properly. Example:
JSON seems to recognize the character, while JSON::SL does not.
The text was updated successfully, but these errors were encountered: