On Thu, Nov 12, 2009 at 4:40 PM, Tomeu Vizoso <[email protected]> wrote: > Is because of a bug in cjson why those files aren't being parsed?
CJSON is not a vanilla parser. It makes a very "strict" reading, that - throws an exception on unordered keys - throws an exception on random whitespace (that is allowed by JSON) - reads redundant escapes (backspaces) literally -- normal json parsers read "foo/bar" and "foo\/bar" both to "foo/bar", because the '/' doesn't need escaping. CJSON reads it to 'foo\/bar' which violates the spec This last problem means that the JEB parser gets the mimetype wrong from files produced by Moodle. But even "formatting" spacing in a JSON file make CJSON throw fits. This is on purpose, because CJSON was created to remove all ambiguity and flexibility from the JSON spec, so that for any given data structure there is only one true way to represent it. This has clear benefits for data that will be signed cryptographically. But is a disaster for interop. More info on CJSON at http://wiki.laptop.org/go/Canonical_JSON m -- [email protected] [email protected] -- School Server Architect - ask interesting questions - don't get distracted with shiny stuff - working code first - http://wiki.laptop.org/go/User:Martinlanghoff _______________________________________________ Devel mailing list [email protected] http://lists.laptop.org/listinfo/devel
