JSON-Syck reviews

cpanratings
 

RSS | Module Info | Add a review of JSON-Syck

JSON-Syck (0.07) *

JSON::Syck is nice, if you need a compact serialization and you will always only use JSON::Syck do actually deserialize your data, but it will not properly work with other JSON decoders and can sometimes generate faulty JavaScript, too.

This is clearly a tweaked YAML encoder and it will generate serializations which are not valid JSON and sometimes, in edge cases, not even valid JavaScript.

Some things you have to look-out for which are still unfixed in the latest version (I have not reported these as bugs anymore as the author now also recommends another module):

- Randomly changes which quotes it outputs - sometimes seems to use " (which is correct JSON), sometimes it uses ' (which is not correct JSON but at least correct JavaScript)
- Will sometimes wrongly escape ' characters and then output '' (that's two apostrophes) instead of \' - this breaks the syntax of your JavaScripts, should you directly include JSON::Syck results into your scripts
- The handling of 8-bit characters is wildly inconsistent. Sometimes they'll be inserted as-is, sometimes it will wrongly escape them with \x - which is valid Perl but not valid JavaScript

As the author said: For true JSON encoding you should probably better use JSON::XS. I, by the way, wildly appreciate that the author recommends a better module - I first found JSON::XS through the hint in the documentation here.

Markus Peter - 2009-06-23T01:49:05 (permalink)

3 out of 3 found this review helpful. Was this review helpful to you?  Yes No