ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/JSON-XS/README
(Generate patch)

Comparing JSON-XS/README (file contents):
Revision 1.36 by root, Wed Jul 27 15:53:40 2011 UTC vs.
Revision 1.37 by root, Thu May 23 09:32:02 2013 UTC

369 output JSON objects by sorting their keys. This is adding a 369 output JSON objects by sorting their keys. This is adding a
370 comparatively high overhead. 370 comparatively high overhead.
371 371
372 If $enable is false, then the "encode" method will output key-value 372 If $enable is false, then the "encode" method will output key-value
373 pairs in the order Perl stores them (which will likely change 373 pairs in the order Perl stores them (which will likely change
374 between runs of the same script). 374 between runs of the same script, and can change even within the same
375 run from 5.18 onwards).
375 376
376 This option is useful if you want the same data structure to be 377 This option is useful if you want the same data structure to be
377 encoded as the same JSON text (given the same overall settings). If 378 encoded as the same JSON text (given the same overall settings). If
378 it is disabled, the same hash might be encoded differently even if 379 it is disabled, the same hash might be encoded differently even if
379 contains the same data, as key-value pairs have no inherent ordering 380 contains the same data, as key-value pairs have no inherent ordering
1320 horribly slow so-called "threads" which are simply slow and bloated 1321 horribly slow so-called "threads" which are simply slow and bloated
1321 process simulations - use fork, it's *much* faster, cheaper, better). 1322 process simulations - use fork, it's *much* faster, cheaper, better).
1322 1323
1323 (It might actually work, but you have been warned). 1324 (It might actually work, but you have been warned).
1324 1325
1326THE PERILS OF SETLOCALE
1327 Sometimes people avoid the Perl locale support and directly call the
1328 system's setlocale function with "LC_ALL".
1329
1330 This breaks both perl and modules such as JSON::XS, as stringification
1331 of numbers no longer works correcly (e.g. "$x = 0.1; print "$x"+1" might
1332 print 1, and JSON::XS might output illegal JSON as JSON::XS relies on
1333 perl to stringify numbers).
1334
1335 The solution is simple: don't call "setlocale", or use it for only those
1336 categories you need, such as "LC_MESSAGES" or "LC_CTYPE".
1337
1338 If you need "LC_NUMERIC", you should enable it only around the code that
1339 actually needs it (avoiding stringification of numbers), and restore it
1340 afterwards.
1341
1325BUGS 1342BUGS
1326 While the goal of this module is to be correct, that unfortunately does 1343 While the goal of this module is to be correct, that unfortunately does
1327 not mean it's bug-free, only that I think its design is bug-free. If you 1344 not mean it's bug-free, only that I think its design is bug-free. If you
1328 keep reporting bugs they will be fixed swiftly, though. 1345 keep reporting bugs they will be fixed swiftly, though.
1329 1346

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines