Loading ...
Sorry, an error occurred while loading the content.

528Re: JSON.pm perl module, utf-8 and the UTF8 flag

Expand Messages
  • Martin J. Evans
    Sep 28, 2006
    • 0 Attachment
      On 28-Sep-2006 Philip Tellis wrote:
      > Sometime Today, MJE cobbled together some glyphs to say:
      >
      >> Hi,
      >>
      >> 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:
      > http://rt.cpan.org/Public/Bug/Display.html?id=19646
      >
      > 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.
      >
      > Philip

      Thanks for the reference Philip.

      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
      --
      Martin J. Evans
      Easysoft Ltd, UK
      http://www.easysoft.com
    • Show all 3 messages in this topic