--- JSON-XS/XS.pm 2007/03/31 14:20:06 1.26 +++ JSON-XS/XS.pm 2007/04/12 07:25:29 1.32 @@ -88,7 +88,7 @@ use strict; BEGIN { - our $VERSION = '1.01'; + our $VERSION = '1.12'; our @ISA = qw(Exporter); our @EXPORT = qw(to_json from_json objToJson jsonToObj); @@ -156,7 +156,9 @@ generate characters outside the code range C<0..127> (which is ASCII). Any unicode characters outside that range will be escaped using either a single \uXXXX (BMP characters) or a double \uHHHH\uLLLLL escape sequence, -as per RFC4627. +as per RFC4627. The resulting encoded JSON text can be treated as a native +unicode string, an ascii-encoded, latin1-encoded or UTF-8 encoded string, +or any other superset of ASCII. If C<$enable> is false, then the C method will not escape Unicode characters unless required by the JSON syntax. This results in a faster @@ -311,7 +313,7 @@ =item $json = $json->max_depth ([$maximum_nesting_depth]) -Sets the maximum nesting level (default C<4096>) accepted while encoding +Sets the maximum nesting level (default C<512>) accepted while encoding or decoding. If the JSON text or Perl data structure has an equal or higher nesting level then this limit, then the encoder and decoder will stop and croak at that point. @@ -475,10 +477,6 @@ You can not currently output JSON booleans or force the type in other, less obscure, ways. Tell me if you need this capability. -=item circular data structures - -Those will be encoded until memory or stackspace runs out. - =back @@ -638,14 +636,15 @@ Third, JSON::XS recurses using the C stack when decoding objects and arrays. The C stack is a limited resource: for instance, on my amd64 -machine with 8MB of stack size I can decode around 180k nested arrays -but only 14k nested JSON objects. If that is exceeded, the program -crashes. Thats why the default nesting limit is set to 4096. If your -process has a smaller stack, you should adjust this setting accordingly -with the C method. +machine with 8MB of stack size I can decode around 180k nested arrays but +only 14k nested JSON objects (due to perl itself recursing deeply on croak +to free the temporary). If that is exceeded, the program crashes. to be +conservative, the default nesting limit is set to 512. If your process +has a smaller stack, you should adjust this setting accordingly with the +C method. And last but least, something else could bomb you that I forgot to think -of. In that case, you get to keep the pieces. I am alway sopen for hints, +of. In that case, you get to keep the pieces. I am always open for hints, though...