528Re: JSON.pm perl module, utf-8 and the UTF8 flag
- Sep 28, 2006On 28-Sep-2006 Philip Tellis wrote:
> Sometime Today, MJE cobbled together some glyphs to say:Thanks for the reference Philip.
>> I can see that a $JSON::UTF8 flag has been added to 1.07 of JSON.pm which is
>> described as:
>> You can set a true value into $JSON::UTF8 for JSON::Parser and
>> JSON::Converter to set UTF8 flag into strings contain utf8.
> I've had problems with JSON.pm and UTF8 on perl 5.6. I'd submitted a
> patch about this here:
> OTOH, we've seen that JSON.pm has really bad performance. YAML::Syck
> appears to be far more performant, probably because it's mainly written
> in C.
I am actually using perl 5.8.8 so I had not seen any problem.
I tried JSON::Syck and have seen it is faster but I didn't like the fact that
the default behavior does not work with utf-8 strings i.e. If you change the
script I previously posted to use JSON::Syck when the utf-8 encoded JSON data
is read back from the file it is now double utf-8 encoded. I realise that
$JSON::Syck::ImplicitUnicode works around this.
Martin J. Evans
Easysoft Ltd, UK
- << Previous post in topic