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.158 by root, Thu Sep 1 11:38:39 2016 UTC vs.
Revision 1.159 by root, Wed Sep 7 17:14:56 2016 UTC

1608 1608
1609=head1 INTEROPERABILITY WITH OTHER MODULES 1609=head1 INTEROPERABILITY WITH OTHER MODULES
1610 1610
1611C<JSON::XS> uses the L<Types::Serialiser> module to provide boolean 1611C<JSON::XS> uses the L<Types::Serialiser> module to provide boolean
1612constants. That means that the JSON true and false values will be 1612constants. That means that the JSON true and false values will be
1613comaptible to true and false values of iother modules that do the same, 1613comaptible to true and false values of other modules that do the same,
1614such as L<JSON::PP> and L<CBOR::XS>. 1614such as L<JSON::PP> and L<CBOR::XS>.
1615 1615
1616 1616
1617=head1 INTEROPERABILITY WITH OTHER JSON DECODERS 1617=head1 INTEROPERABILITY WITH OTHER JSON DECODERS
1618 1618
1635 1635
1636When you use C<allow_tags> to use the extended (and also nonstandard and 1636When you use C<allow_tags> to use the extended (and also nonstandard and
1637invalid) JSON syntax for serialised objects, and you still want to decode 1637invalid) JSON syntax for serialised objects, and you still want to decode
1638the generated When you want to serialise objects, you can run a regex 1638the generated When you want to serialise objects, you can run a regex
1639to replace the tagged syntax by standard JSON arrays (it only works for 1639to replace the tagged syntax by standard JSON arrays (it only works for
1640"normal" packagesnames without comma, newlines or single colons). First, 1640"normal" package names without comma, newlines or single colons). First,
1641the readable Perl version: 1641the readable Perl version:
1642 1642
1643 # if your FREEZE methods return no values, you need this replace first: 1643 # if your FREEZE methods return no values, you need this replace first:
1644 $json =~ s/\( \s* (" (?: [^\\":,]+|\\.|::)* ") \s* \) \s* \[\s*\]/[$1]/gx; 1644 $json =~ s/\( \s* (" (?: [^\\":,]+|\\.|::)* ") \s* \) \s* \[\s*\]/[$1]/gx;
1645 1645
1681Since this module was written, Google has written a new JSON RFC, RFC 7159 1681Since this module was written, Google has written a new JSON RFC, RFC 7159
1682(and RFC7158). Unfortunately, this RFC breaks compatibility with both the 1682(and RFC7158). Unfortunately, this RFC breaks compatibility with both the
1683original JSON specification on www.json.org and RFC4627. 1683original JSON specification on www.json.org and RFC4627.
1684 1684
1685As far as I can see, you can get partial compatibility when parsing by 1685As far as I can see, you can get partial compatibility when parsing by
1686using C<< ->allow_nonref >>. However, consider thew security implications 1686using C<< ->allow_nonref >>. However, consider the security implications
1687of doing so. 1687of doing so.
1688 1688
1689I haven't decided yet when to break compatibility with RFC4627 by default 1689I haven't decided yet when to break compatibility with RFC4627 by default
1690(and potentially leave applications insecure) and change the default to 1690(and potentially leave applications insecure) and change the default to
1691follow RFC7159, but application authors are well advised to call C<< 1691follow RFC7159, but application authors are well advised to call C<<
1692->allow_nonref(0) >> even if this is the current default, if they cannot 1692->allow_nonref(0) >> even if this is the current default, if they cannot
1693handle non-reference values, in preparation for the day when the4 default 1693handle non-reference values, in preparation for the day when the default
1694will change. 1694will change.
1695 1695
1696 1696
1697=head1 THREADS 1697=head1 THREADS
1698 1698

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines