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

Comparing JSON-XS/XS.pm (file contents):
Revision 1.115 by root, Tue Feb 17 23:29:38 2009 UTC vs.
Revision 1.116 by root, Tue Feb 17 23:41:20 2009 UTC

1237around it in every other generator. The above regexes should work well in 1237around it in every other generator. The above regexes should work well in
1238other languages, as long as they operate on UTF-8. It is equally valid to 1238other languages, as long as they operate on UTF-8. It is equally valid to
1239replace all occurences of U+2028/2029 directly by their \\u-escaped forms 1239replace all occurences of U+2028/2029 directly by their \\u-escaped forms
1240in unicode texts, so they can simply be used to fix any parsers relying on 1240in unicode texts, so they can simply be used to fix any parsers relying on
1241C<eval> by first applying the regexes on the encoded texts. 1241C<eval> by first applying the regexes on the encoded texts.
1242
1243Note also that the above only works for U+2028 and U+2029 and thus
1244only for fully ECMAscript-compliant parsers. Many existing javascript
1245implementations misparse other characters as well. Best rely on a good
1246JSON parser, such as Douglas Crockfords F<json2.js>, which escapes the
1247above and many more problematic characters properly before passing them
1248into C<eval>.
1242 1249
1243Another problem is that some javascript implementations reserve 1250Another problem is that some javascript implementations reserve
1244some property names for their own purposes (which probably makes 1251some property names for their own purposes (which probably makes
1245them non-ECMAscript-compliant). For example, Iceweasel reserves the 1252them non-ECMAscript-compliant). For example, Iceweasel reserves the
1246C<__proto__> property name for it's own purposes. 1253C<__proto__> property name for it's own purposes.

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines