Reviews by keywan g.

cpanratings
 

RSS

JSON-XS (2.32) *****

perfect, i use it for AJAX, Settings, Translations and it performs great.

When using JSON with utf8 files you have to make a desisson
1. read/write with ":encoding(utf-8)" and do NOT use json->new->utf8()
2. read/write raw files(binmode,:raw) and use json->new->utf8()

(tested with perl 5.12)

If the files can have BOM i prefere reading it with File::BOM
my $encoding = open_bom(FH, $path, ':encoding(utf-8)');
local $/;
my $data = <FH>;

my $json = $self->[json] = JSON::XS->new;
$json->relaxed(1);
$json->pretty(1);
$h = $json->decode($data);