Cpanel-JSON-XS
view release on metacpan or search on metacpan
- Fix memory corruption in sv_to_ivuv() function (#136 by Pali)
- Add new method ->require_types (#135 by Pali)
- Fix typed json encoder conversion from scalar's PV and NV slot to
JSON_TYPE_INT (#133, #134 by Pali)
- Fix inconsistency with warnings in typed json encoder (#131 by Pali)
- Fix Perl 5.8.0 support (#130 by Pali)
- Fixed minor pod typo (#129 by sheeit)
- Document invalid recursive callbacks or overloads (#128)
4.11 2019-03-26 (rurban)
- Fix unicode strings with BOM corrupt ->utf8 state (#125)
The BOM encoding effects only its very own decode call,
not its object.
4.10 2019-03-18 (rurban)
- Fix incr_text refcounts (#123)
- Add incr_rest testcase (#123)
- Fix encode_stringify string-overload refcnt problem (#124)
"Attempt to free unreferenced scalar" with convert_blessed and overload.
4.09 2019-02-15 (rurban)
we cannot know if msvcrt.dll or the new ucrt.dll is used.
try a list of valid values.
3.0236 2017-07-27 (rurban)
- Stringify true again as "1", not as "true" due to popular demand.
(haarg #87)
3.0235 2017-07-27 (rurban)
- Disallow duplicate keys by default, only allow them in relaxed
mode. (#75)
Analog to invalid unicode, which does error by default.
RFC 7159 section 4 says that "The names within an object should be unique."
So it's either i_ (undefined) or n_ (errors).
See http://seriot.ch/parsing_json.php#24
This is different to the other JSON modules, which do have a different
interpretation of the spec. Use relaxed for backcompat if you want to
allow duplicate keys.
- De-fragilize t/96_mojo.t false test to "". It mostly is.
3.0234 2017-07-27 (rurban)
- Fix and unify utf8 handling with 5.6.2
- fixes for g++-6, stricter -fpermissive and -Wc++11-compat
3.0223 2016-11-16 (rurban)
- fixed decode bignum with a string prefix. #76, patch by GilmarSantosJr.
3.0222 2016-10-30 (rurban)
- enable decode_bom for multibyte encodings UTF16 and UTF32.
encode internally to UTF-8.
3.0221 2016-10-30 (rurban)
- fixed documentation of decode for unicode noncharacters.
added correct code to warn as in core.
no replacement, ignore warnings when in relaxed mode.
We used a wrong range also, but the wrong code from 3.02220
was never executed because of an coding error. #73, #74
- Fixed a perl 5.6 compilation regression from 3.0220.
- Improve decode_bom for multibyte encoding, but not yet enabled.
refcount error.
- Add 5.24 to travis tests
3.0220 2016-10-28 (rurban)
- add comprehensive JSON decode spectests from
http://seriot.ch/parsing_json.html. #72
- decode with BOM (UTF-8, UTF-16, or UTF-32). For now only UTF-8,
the others error.
- fixed detection of final \0 as illegal non-whitespace garbage. Fixes
spectest 'n_number_then_00'. #72
- changed decode of unicode noncharacters between U+FFFD and U+10FFFF
to the recommended U+FFFD REPLACEMENT CHARACTER, when not in the binary
or relaxed mode.
- fail decode of non-unicode raw characters above U+10FFFF
when not in relaxed mode.
3.0219 2016-10-26 (rurban)
- workaround mingw 4.0 modfl() bug [perl #125924]
3.0218 2016-10-13 (rurban)
- no changes
3.0217_06 2016-10-08 (rurban)
- fix DPPP_dummy_PL_parser warnings
hanging with single quotes in normal strings. #54
(reported by Quim Rovira)
3.0208 2015-12-02 (rurban)
- Fix regression for is_bool([]), with unblessed references. #53
(reported by Gregory Oschwald)
3.0207 2015-12-02 (rurban)
- Fix regression decoding big strings (>16384). #50 (reported by Dan Book)
- Ignore allow_barekey if we detect quotes. #51 (Fixed by Quim Rovira)
- Skip some unicode tests with 5.6
3.0206 2015-11-30 (rurban)
- Add support for escape_slash from JSON::PP. #47
- Map sort_by to canonical from JSON::PP. #47
reverse sort or sort by custom keys not yet possible/silently ignored.
- Add support for allow_singlequote from JSON::PP. #47
- Add support for allow_barekey from JSON::PP. #47
- Add support for allow_bignum from JSON::PP. #47
- relaxed uses now also allow_singlequote and allow_barekey.
- Fixed t/20_unknown.t: SKIP when JSON is not available. #45
1.52 2007-10-15 03:22:06
- remove =encoding pod directive again, it confuses too many pod
parsers :/.
1.51 2007-10-13 03:55:56
- encode empty arrays/hashes in a compact way when pretty is enabled.
- apparently JSON::XS was used to find some bugs in the
JSON_checker testsuite, so add (the corrected) JSON_checker tests to
the testsuite.
- quite a bit of doc updates/extension.
- require 5.8.2, as this seems to be the first unicode-stable version.
1.5 2007-08-28 04:05:38
- add support for tied hashes, based on ideas and testcase by
Marcus Holland-Moritz.
- implemented relaxed parsing mode where some extensions are being
accepted. generation is still JSON-only.
1.44 2007-08-22 01:02:44
- very experimental process-emulation support, slowing everything down.
the horribly broken perl threads are still not supported - YMMV.
- require 5.8.8 explicitly as older perls do not seem to offer
the required macros.
- possibly made it compile on so-called C compilers by microsoft.
1.21 2007-05-09 18:40:32
- character offset reported for trailing garbage was random.
1.2 2007-05-09 18:35:01
- decode did not work with magical scalars (doh!).
- added latin1 flag to produce JSON texts in the latin1 subset
of unicode.
- flag trailing garbage as error.
- new decode_prefix method that returns the number
of characters consumed by a decode.
- max octets/char in perls UTF-X is actually 13, not 11,
as pointed out by Glenn Linderman.
- fixed typoe reported by YAMASHINA Hio.
1.11 2007-04-09 07:05:49
- properly 0-terminate sv's returned by encode to help
C libraries that expect that 0 to be there.
they will by default enable their flag.
- considerably improved string encoding speed (at least
with gcc 4).
- added a test that covers lots of different characters.
- clarified some error messages.
- error messages now use correct character offset
with F_UTF8.
- improve the "no bytes" and "no warnings" hacks in
case the called functions do... stuff.
- croak when encoding to ascii and an out-of-range
(non-unicode) codepoint is encountered.
0.2 2007-03-23 00:23:34
- the "could not sleep without debugging release".
it should basically work now, with many bugs as
no production tests have been run yet.
- added more testcases.
- the expected shitload of bugfixes.
- handle utf8 flag correctly in decode.
- fix segfault in decoder.
- utf8n_to_uvuni sets retlen to -1, but retlen is an
t/52_object.t
t/53_readonly.t
t/54_stringify.t
t/55_modifiable.t
t/96_interop.t
t/96_interop_pp.t
t/96_mojo.t
t/97_unshare_hek.t
t/98_56only.t
t/99_binary.t
t/_unicode_handling.pm
t/appveyor-test.bat
t/test_parsing/i_number_neg_int_huge_exp.json
t/test_parsing/i_number_pos_double_huge_exp.json
t/test_parsing/i_object_key_lone_2nd_surrogate.json
t/test_parsing/i_string_1st_surrogate_but_2nd_missing.json
t/test_parsing/i_string_1st_valid_surrogate_2nd_invalid.json
t/test_parsing/i_string_UTF-16_invalid_lonely_surrogate.json
t/test_parsing/i_string_UTF-16_invalid_surrogate.json
t/test_parsing/i_string_UTF-8_invalid_sequence.json
t/test_parsing/i_string_incomplete_surrogate_and_escape_valid.json
t/test_parsing/i_string_incomplete_surrogate_pair.json
t/test_parsing/i_string_incomplete_surrogates_escape_valid.json
t/test_parsing/i_string_inverted_surrogates_U+1D11E.json
t/test_parsing/i_string_lone_second_surrogate.json
t/test_parsing/i_string_not_in_unicode_range.json
t/test_parsing/i_string_truncated-utf-8.json
t/test_parsing/i_string_unicode_U+10FFFE_nonchar.json
t/test_parsing/i_string_unicode_U+1FFFE_nonchar.json
t/test_parsing/i_string_unicode_U+FDD0_nonchar.json
t/test_parsing/i_string_unicode_U+FFFE_nonchar.json
t/test_parsing/i_structure_500_nested_arrays.json
t/test_parsing/i_structure_UTF-8_BOM_empty_object.json
t/test_parsing/n_array_1_true_without_comma.json
t/test_parsing/n_array_a_invalid_utf8.json
t/test_parsing/n_array_colon_instead_of_comma.json
t/test_parsing/n_array_comma_after_close.json
t/test_parsing/n_array_comma_and_number.json
t/test_parsing/n_array_double_comma.json
t/test_parsing/n_array_double_extra_comma.json
t/test_parsing/n_array_extra_close.json
t/test_parsing/n_string_backslash_00.json
t/test_parsing/n_string_escape_x.json
t/test_parsing/n_string_escaped_backslash_bad.json
t/test_parsing/n_string_escaped_ctrl_char_tab.json
t/test_parsing/n_string_escaped_emoji.json
t/test_parsing/n_string_incomplete_escape.json
t/test_parsing/n_string_incomplete_escaped_character.json
t/test_parsing/n_string_incomplete_surrogate_escape_invalid.json
t/test_parsing/n_string_invalid-utf-8-in-escape.json
t/test_parsing/n_string_invalid_backslash_esc.json
t/test_parsing/n_string_invalid_unicode_escape.json
t/test_parsing/n_string_invalid_utf-8.json
t/test_parsing/n_string_invalid_utf8_after_escape.json
t/test_parsing/n_string_iso_latin_1.json
t/test_parsing/n_string_leading_uescaped_thinspace.json
t/test_parsing/n_string_lone_utf8_continuation_byte.json
t/test_parsing/n_string_no_quotes_with_bad_escape.json
t/test_parsing/n_string_overlong_sequence_2_bytes.json
t/test_parsing/n_string_overlong_sequence_6_bytes.json
t/test_parsing/n_string_overlong_sequence_6_bytes_null.json
t/test_parsing/n_string_single_doublequote.json
t/test_parsing/n_string_single_quote.json
t/test_parsing/n_string_single_string_no_double_quotes.json
t/test_parsing/n_string_start_escape_unclosed.json
t/test_parsing/n_string_unescaped_crtl_char.json
t/test_parsing/n_string_unescaped_newline.json
t/test_parsing/n_string_unescaped_tab.json
t/test_parsing/n_string_unicode_CapitalU.json
t/test_parsing/n_string_with_trailing_garbage.json
t/test_parsing/n_structure_100000_opening_arrays.json
t/test_parsing/n_structure_U+2060_word_joined.json
t/test_parsing/n_structure_UTF8_BOM_no_data.json
t/test_parsing/n_structure_array_trailing_garbage.json
t/test_parsing/n_structure_array_with_extra_array_close.json
t/test_parsing/n_structure_array_with_unclosed_string.json
t/test_parsing/n_structure_ascii-unicode-identifier.json
t/test_parsing/n_structure_capitalized_True.json
t/test_parsing/n_structure_close_unopened_array.json
t/test_parsing/n_structure_comma_instead_of_closing_brace.json
t/test_parsing/n_structure_double_array.json
t/test_parsing/n_structure_end_array.json
t/test_parsing/n_structure_incomplete_UTF8_BOM.json
t/test_parsing/n_structure_lone-invalid-utf-8.json
t/test_parsing/n_structure_lone-open-bracket.json
t/test_parsing/n_structure_lt.gt.json
t/test_parsing/n_structure_ltnullgt.json
t/test_parsing/n_structure_open_open.json
t/test_parsing/n_structure_single_point.json
t/test_parsing/n_structure_single_star.json
t/test_parsing/n_structure_trailing_#.json
t/test_parsing/n_structure_uescaped_LF_before_string.json
t/test_parsing/n_structure_unclosed_array.json
t/test_parsing/n_structure_unclosed_array_partial_null.json
t/test_parsing/n_structure_unclosed_array_unfinished_false.json
t/test_parsing/n_structure_unclosed_array_unfinished_true.json
t/test_parsing/n_structure_unclosed_object.json
t/test_parsing/n_structure_unicode-identifier.json
t/test_parsing/n_structure_whitespace_U+2060_word_joiner.json
t/test_parsing/n_structure_whitespace_formfeed.json
t/test_parsing/y_array_arraysWithSpaces.json
t/test_parsing/y_array_empty-string.json
t/test_parsing/y_array_empty.json
t/test_parsing/y_array_ending_with_newline.json
t/test_parsing/y_array_false.json
t/test_parsing/y_array_heterogeneous.json
t/test_parsing/y_array_null.json
t/test_parsing/y_array_with_1_and_newline.json
t/test_parsing/y_object.json
t/test_parsing/y_object_basic.json
t/test_parsing/y_object_duplicated_key.json
t/test_parsing/y_object_duplicated_key_and_value.json
t/test_parsing/y_object_empty.json
t/test_parsing/y_object_empty_key.json
t/test_parsing/y_object_escaped_null_in_key.json
t/test_parsing/y_object_extreme_numbers.json
t/test_parsing/y_object_long_strings.json
t/test_parsing/y_object_simple.json
t/test_parsing/y_object_string_unicode.json
t/test_parsing/y_object_with_newlines.json
t/test_parsing/y_string_1_2_3_bytes_UTF-8_sequences.json
t/test_parsing/y_string_UTF-16_Surrogates_U+1D11E_MUSICAL_SYMBOL_G_CLEF.json
t/test_parsing/y_string_accepted_surrogate_pair.json
t/test_parsing/y_string_accepted_surrogate_pairs.json
t/test_parsing/y_string_allowed_escapes.json
t/test_parsing/y_string_backslash_and_u_escaped_zero.json
t/test_parsing/y_string_backslash_doublequotes.json
t/test_parsing/y_string_comments.json
t/test_parsing/y_string_double_escape_a.json
t/test_parsing/y_string_one-byte-utf-8.json
t/test_parsing/y_string_pi.json
t/test_parsing/y_string_simple_ascii.json
t/test_parsing/y_string_space.json
t/test_parsing/y_string_three-byte-utf-8.json
t/test_parsing/y_string_two-byte-utf-8.json
t/test_parsing/y_string_u+2028_line_sep.json
t/test_parsing/y_string_u+2029_par_sep.json
t/test_parsing/y_string_uEscape.json
t/test_parsing/y_string_unescaped_char_delete.json
t/test_parsing/y_string_unicode.json
t/test_parsing/y_string_unicodeEscapedBackslash.json
t/test_parsing/y_string_unicode_2.json
t/test_parsing/y_string_unicode_U+200B_ZERO_WIDTH_SPACE.json
t/test_parsing/y_string_unicode_U+2064_invisible_plus.json
t/test_parsing/y_string_unicode_escaped_double_quote.json
t/test_parsing/y_string_utf16.json
t/test_parsing/y_string_utf16be.json
t/test_parsing/y_string_utf32.json
t/test_parsing/y_string_utf32be.json
t/test_parsing/y_string_utf8.json
t/test_parsing/y_string_with_del_character.json
t/test_parsing/y_structure_lonely_false.json
t/test_parsing/y_structure_lonely_int.json
t/test_parsing/y_structure_lonely_negative_real.json
t/test_parsing/y_structure_lonely_null.json
# exported functions, they croak on error
# and expect/generate UTF-8
$utf8_encoded_json_text = encode_json $perl_hash_or_arrayref;
$perl_hash_or_arrayref = decode_json $utf8_encoded_json_text;
# OO-interface
$coder = Cpanel::JSON::XS->new->ascii->pretty->allow_nonref;
$pretty_printed_unencoded = $coder->encode ($perl_scalar);
$perl_scalar = $coder->decode ($unicode_json_text);
# Note that 5.6 misses most smart utf8 and encoding functionalities
# of newer releases.
# Note that L<JSON::MaybeXS> will automatically use Cpanel::JSON::XS
# if available, at virtually no speed overhead either, so you should
# be able to just:
use JSON::MaybeXS;
NOK type. However !!1 which is wrongly encoded in 5.8 as "1"/1.0 is
still represented as integer.
- different handling of inf/nan. Default now to null, optionally with
stringify_infnan() to "inf"/"nan". [#28, #32]
- added "binary" extension, non-JSON and non JSON parsable, allows
"\xNN" and "\NNN" sequences.
- 5.6.2 support; sacrificing some utf8 features (assuming bytes
all-over), no multi-byte unicode characters with 5.6.
- interop for true/false overloading. JSON::XS, JSON::PP and Mojo::JSON
representations for booleans are accepted and JSON::XS accepts
Cpanel::JSON::XS booleans [#13, #37] Fixed overloading of booleans.
Cpanel::JSON::XS::true stringifies again to "1", not "true", analog to
all other JSON modules.
- native boolean mapping of yes and no to true and false, as in
YAML::XS. In perl "!0" is yes, "!1" is no. The JSON value true maps to
1, false maps to 0. [#39]
- #7, #29 avoid re-blessing where possible. It fails in JSON::XS for
READONLY values, i.e. restricted hashes.
- #41 overloading of booleans, use the object not the reference.
- #62 -Dusequadmath conversion and no SEGV.
- #72 parsing of values followed \0, like 1\0 does fail.
- #72 parsing of illegal unicode or non-unicode characters.
- #96 locale-insensitive numeric conversion.
- #154 numeric conversion fixed since 5.22, using the same strtold as perl5.
- #167 sort tied hashes with canonical.
- #212 fix utf8 object stringification
- public maintenance and bugtracker
- extended testsuite, passes all
http://seriot.ch/projects/parsing_json.html tests. In fact it is the
only know JSON decoder which does so, while also being the fastest.
- support many more options and methods from JSON::PP: stringify_infnan,
allow_unknown, allow_stringify, allow_barekey, encode_stringify,
allow_bignum, allow_singlequote, dupkeys_as_arrayref, sort_by
(partially), escape_slash, convert_blessed, ... optional decode_json(,
allow_nonref) arg. relaxed implements allow_dupkeys.
- support all 5 unicode BOM's: UTF-8, UTF-16LE, UTF-16BE, UTF-32LE,
UTF-32BE, encoding internally to UTF-8.
FUNCTIONAL INTERFACE
The following convenience methods are provided by this module. They are
exported by default:
$json_text = encode_json $perl_scalar, [json_type]
Converts the given Perl data structure to a UTF-8 encoded, binary
string (that is, the string contains octets only). Croaks on error.
4. A "Unicode String" is simply a string where each character can be
validly interpreted as a Unicode code point.
If you have UTF-8 encoded data, it is no longer a Unicode string,
but a Unicode string encoded in UTF-8, giving you a binary string.
5. A string containing "high" (> 255) character values is *not* a UTF-8
string.
6. Raw non-Unicode characters below U+10FFFF are allowed.
The 66 Unicode noncharacters U+FDD0..U+FDEF, and U+*FFFE, U+*FFFF
are allowed without warning, as JSON::PP does, see
<http://www.unicode.org/versions/corrigendum9.html>. But illegal
surrogate pairs fail to parse.
7. Raw non-Unicode characters above U+10FFFF are disallowed.
Raw non-Unicode characters outside the valid unicode range fail to
parse, because "A string is a sequence of zero or more Unicode
characters" RFC 7159 section 1 and "JSON text SHALL be encoded in
Unicode RFC 7159 section 8.1. We use now the UTF8_DISALLOW_SUPER
flag when parsing unicode.
8. Lone surrogates or illegal surrogate pairs are disallowed.
Since RFC 3629, U+D800 through U+DFFF are not legal Unicode values
and their UTF-8 encodings must be treated as an invalid byte
sequence. RFC 8259 section 8.2 admits the spec allows string values
that contain bit sequences that cannot encode Unicode characters and
that the behavior of software that receives such values is
unpredictable. To avoid introducing non-Unicode strings into Perl we
use the UTF8_DISALLOW_SURROGATE flag when parsing Unicode and verify
escaped surrogates form valid pairs.
contain new "\xNN" sequences, which is unparsable JSON. The "decode"
method forbids "\uNNNN" sequences and accepts "\xNN" and octal
"\NNN" sequences.
There is also a special logic for perl 5.6 and utf8. 5.6 encodes any
string to utf-8 automatically when seeing a codepoint >= 0x80 and <
0x100. With the binary flag enabled decode the perl utf8 encoded
string to the original byte encoding and encode this with "\xNN"
escapes. This will result to the same encodings as with newer perls.
But note that binary multi-byte codepoints with 5.6 will result in
"illegal unicode character in binary string" errors, unlike with
newer perls.
If $enable is false, then the "encode" method will smartly try to
detect Unicode characters unless required by the JSON syntax or
other flags and hex and octal sequences are forbidden.
See also the section *ENCODING/CODESET FLAG NOTES* later in this
document.
The main use for this flag is to avoid the smart unicode detection
and possible double encoding. The disadvantage is that the resulting
JSON text is encoded in new "\xNN" and in latin1 characters and must
correctly be treated as such when storing and transferring, a rare
encoding for JSON. It will produce non-readable JSON strings in the
browser. It is therefore most useful when you want to store data
structures known to contain binary data efficiently in files or
databases, not when talking to other JSON encoders/decoders. The
binary decoding method can also be used when an encoder produced a
non-JSON conformant hex or octal encoding "\xNN" or "\NNN".
Cpanel::JSON::XS->new->binary->encode (["\x{89}\x{abc}"])
5.6: Error: malformed or illegal unicode character in binary string
>=5.8: ['\x89\xe0\xaa\xbc']
Cpanel::JSON::XS->new->binary->encode (["\x{89}\x{bc}"])
=> ["\x89\xbc"]
Cpanel::JSON::XS->new->binary->decode (["\x89\ua001"])
Error: malformed or illegal unicode character in binary string
Cpanel::JSON::XS->new->decode (["\x89"])
Error: illegal hex character in non-binary string
$json = $json->utf8 ([$enable])
$enabled = $json->get_utf8
If $enable is true (or missing), then the "encode" method will
encode the JSON result into UTF-8, as required by many protocols,
while the "decode" method expects to be handled an UTF-8-encoded
string. Please note that UTF-8-encoded strings do not contain any
sysread $fh, my $buf, 65536
or die "read error: $!";
$json->incr_parse ($buf); # void context, so no parsing
}
This is a complex example, but most of the complexity comes from the
fact that we are trying to be correct (bear with me if I am wrong, I
never ran the above example :).
BOM
Detect all unicode Byte Order Marks on decode. Which are UTF-8,
UTF-16LE, UTF-16BE, UTF-32LE and UTF-32BE.
The BOM encoding is set only for one specific decode call, it does not
change the state of the JSON object.
Warning: With perls older than 5.20 you need load the Encode module
before loading a multibyte BOM, i.e. >= UTF-16. Otherwise an error is
thrown. This is an implementation limitation and might get fixed later.
See <https://tools.ietf.org/html/rfc7159#section-8.1> *"JSON text SHALL
be encoded in UTF-8, UTF-16, or UTF-32."*
*"Implementations MUST NOT add a byte order mark to the beginning of a
JSON text", "implementations (...) MAY ignore the presence of a byte
order mark rather than treating it as an error".*
See also <http://www.unicode.org/faq/utf_bom.html#BOM>.
Beware that Cpanel::JSON::XS is currently the only JSON module which
does accept and decode a BOM.
The latest JSON spec
<https://www.greenbytes.de/tech/webdav/rfc8259.html#character.encoding>
forbid the usage of UTF-16 or UTF-32, the character encoding is UTF-8.
Thus in subsequent updates BOM's of UTF-16 or UTF-32 will throw an
error.
"__proto__" property name for its own purposes.
If that is a problem, you could parse try to filter the resulting JSON
output for these property strings, e.g.:
$json =~ s/"__proto__"\s*:/"__proto__renamed":/g;
This works because "__proto__" is not valid outside of strings, so every
occurrence of ""__proto__"\s*:" must be a string used as property name.
Raw non-Unicode characters outside the valid unicode range fail now to
parse, because "A string is a sequence of zero or more Unicode
characters" RFC 7159 section 1 and "JSON text SHALL be encoded in
Unicode RFC 7159 section 8.1. We use now the UTF8_DISALLOW_SUPER flag
when parsing unicode.
Since RFC 3629, U+D800 through U+DFFF are not legal Unicode values and
their UTF-8 encodings must be treated as an invalid byte sequence. RFC
8259 section 8.2 admits the spec allows string values that contain bit
sequences that cannot encode Unicode characters and that the behavior of
software that receives such values is unpredictable. To avoid
introducing non-Unicode strings into Perl we use the
UTF8_DISALLOW_SURROGATE flag when parsing Unicode and verify escaped
surrogates form valid pairs.
SHA256 59c743137453c8c4e9e785a15dcd057b0209d5ce160d683d7ab416dc37a92b6d t/52_object.t
SHA256 3b9ce402e2d0cae8a525df4beca05f2656ba5cf02b074d02fd690fe97773d2d7 t/53_readonly.t
SHA256 a08be137b59c9cd58410bc41969e1e9e9fa2159469523394b6bfd0c798c00908 t/54_stringify.t
SHA256 f542b8cfd2bee5ab9ae92dd042e3bbf68a968ae959d0eeada43cd5cd53c8337a t/55_modifiable.t
SHA256 7e825a17dc348ddee2b61e686a670115c31d80f372a7614e27811b9f3d795c79 t/96_interop.t
SHA256 f720857c5fb03c62aab4765610ab05326e5139505f823400605abaebedffeb32 t/96_interop_pp.t
SHA256 40683e1922b62e46053ee60bf4c94e2ca9dbbe0da9d3131c16b4ef49045feb0a t/96_mojo.t
SHA256 f847d17e014f19232281a3f44184da5f6dc0d1efb2d817d03156d1ff3d152afa t/97_unshare_hek.t
SHA256 6b6c59c5f260f28afca3ccfe0785fb8da328ee3aa259079ef5dd982822862726 t/98_56only.t
SHA256 fc880ee039642bcb1517cdb4afaa8060471785b521df45d295b50041137211e5 t/99_binary.t
SHA256 434615b31e85838d8d1d34d85b67bf427dc2b7314d7f868a62ff5c13027638e1 t/_unicode_handling.pm
SHA256 61b20d1f63cbbf9a9dfd757117927cda492e1a5bab7ed0d2790c82321819f845 t/appveyor-test.bat
SHA256 92123944cf252563cc9d402ad83df085a20f9899144b3b59661f898fcffd1e2b t/test_parsing/i_number_neg_int_huge_exp.json
SHA256 873f021ffd6efe214578e87c45c470aa1e6fba5507eae9f17f4ad3544c1278ff t/test_parsing/i_number_pos_double_huge_exp.json
SHA256 3c8f12d1d98603cc19dc6428e2ca50fd5055405a9ee84eff134edc07e66e155b t/test_parsing/i_object_key_lone_2nd_surrogate.json
SHA256 614fddf8cc37b552fd23b6fed4bd1e5b78ddfa86b8e3870f089c8f6e90ccf8f1 t/test_parsing/i_string_1st_surrogate_but_2nd_missing.json
SHA256 eb291cafd21f78d8c6de009c084361c3b4ff3043c44a4d2e122d8d5bd5955901 t/test_parsing/i_string_1st_valid_surrogate_2nd_invalid.json
SHA256 69119aac5ce42bc93c1667db0454297ffaa342c431efa2dfdf48af101c035106 t/test_parsing/i_string_UTF-16_invalid_lonely_surrogate.json
SHA256 741eff3218368e2fc13a93ce6993548a83719ed3c05a78db3de6ef8ab7eab64e t/test_parsing/i_string_UTF-16_invalid_surrogate.json
SHA256 93d762e06089733df04d765462ac2da5e60ab1d691e5a57708b27ed4e3342968 t/test_parsing/i_string_UTF-8_invalid_sequence.json
SHA256 a6b1fba2b092852036b6ade42b4f59a7ad0754bc93f92c25b359db90dfb956ce t/test_parsing/i_string_incomplete_surrogate_and_escape_valid.json
SHA256 823b370458fa84f32efaf461472abba66a29d1873ba77b81cb9b5213f6df79e6 t/test_parsing/i_string_incomplete_surrogate_pair.json
SHA256 a1ee85c5d6cec2cc0cea8b91ec6d6c253f2bb7d2bd48a2ce5e9f0db49d9d0b32 t/test_parsing/i_string_incomplete_surrogates_escape_valid.json
SHA256 17dc4691fa7a327ac3411391f7d3b5db983715391f8dfee1c008ffb453959fff t/test_parsing/i_string_inverted_surrogates_U+1D11E.json
SHA256 24b9bc232f8cf6dff1869f7ef72790c7c5aac9c7529dd9c36427bb012bc20f37 t/test_parsing/i_string_lone_second_surrogate.json
SHA256 1e4a55bc32c7de4b1af008ed206899f4debd32ce7676e11b017633aba8a548f8 t/test_parsing/i_string_not_in_unicode_range.json
SHA256 65fd4cdbf6c28fe2d4e18f81ea37e154a90198fae4fe923eb41533dbd301cb02 t/test_parsing/i_string_truncated-utf-8.json
SHA256 95affe1744a2fb5a585d0a4a8b28b3238f36473ac55e21b43ead5e9824389eb3 t/test_parsing/i_string_unicode_U+10FFFE_nonchar.json
SHA256 1522be6352030d1fea7484adcccd731408f3f000fe893b567c4cc6fc79378ad6 t/test_parsing/i_string_unicode_U+1FFFE_nonchar.json
SHA256 093f3d1b0f5c40df1427a3bbb8e1999df3e923f475b0a9655c1a7eafbf69ebe3 t/test_parsing/i_string_unicode_U+FDD0_nonchar.json
SHA256 7e7d42cac051b1e55f093262ecb8cda1cc080cb9cde6a2cbe163b7a5db9fbfa9 t/test_parsing/i_string_unicode_U+FFFE_nonchar.json
SHA256 a6c6b45361ff77e7372a015a1f0289e9c09d1fe1ed59cf9773d599c55acf57cf t/test_parsing/i_structure_500_nested_arrays.json
SHA256 aa25e978046d680ef8740d837e6de5bc1e2a2dc6089dbda1012544b538d53f65 t/test_parsing/i_structure_UTF-8_BOM_empty_object.json
SHA256 66510f3118b7ede39314518bc5a1bc71eb2b4d36a8a01cb0e76829be6768409b t/test_parsing/n_array_1_true_without_comma.json
SHA256 00308ed1d30dd0c6248a36107049cfe7a4a795c774e252d6eeec4d64ccee4aad t/test_parsing/n_array_a_invalid_utf8.json
SHA256 b4bceb6e7fefaf43b73f472b8c260c5aad24610faea9a1abe6b9a3035065deb4 t/test_parsing/n_array_colon_instead_of_comma.json
SHA256 31f674b45f5eaff8419175ab479b1e8d5946d3fae55106a86f116d77f58672be t/test_parsing/n_array_comma_after_close.json
SHA256 2b3646f1ef5cf8b30a71b9e140e89b77da7eb4354ddc1f346f57ffc66ad68cd0 t/test_parsing/n_array_comma_and_number.json
SHA256 1b4a2022b0702d87a15a49f031e9795ab6824cb3945c106bcfa5ad55c2e945cc t/test_parsing/n_array_double_comma.json
SHA256 2161a4ca5aa1599950752bf9aa8a42358035362098dc702e9bde01dc05f3a674 t/test_parsing/n_array_double_extra_comma.json
SHA256 b9ffad41832eeef97b229c9de4f664d7ad3bd3094ebdf5342729564427b1688f t/test_parsing/n_array_extra_close.json
SHA256 245950d0f3fde1ac886cd7c16b5e7a0dd612dfcd5ba4fdad33b731f8e3d65a72 t/test_parsing/n_string_backslash_00.json
SHA256 e51a0dfa4018434feaf3918d5e94d3a6139a4a80af3b0880d5387c54740d9606 t/test_parsing/n_string_escape_x.json
SHA256 7e38d58c88a6f593c1dccc11accd719032a0ac34e8169fc81cd70dfbcba9d7ba t/test_parsing/n_string_escaped_backslash_bad.json
SHA256 50b34150204026c1a7f138035f9f375efe28b90bd594241d80d34bdff5ffdbdd t/test_parsing/n_string_escaped_ctrl_char_tab.json
SHA256 8ad7e4922258492dc7d254e91385d6cb5b6b7d9c82ebb8488228fb8d294850d5 t/test_parsing/n_string_escaped_emoji.json
SHA256 df3709e1b19bc2562a9bc0301265c237ca5a5b35bd9bc5c3a7f45c57092e0537 t/test_parsing/n_string_incomplete_escape.json
SHA256 f3b21db18eed4ce123ecd20c64798ce33a9f409adba22ff49cec573856405fe7 t/test_parsing/n_string_incomplete_escaped_character.json
SHA256 006c749ff0f0e82a966ca6060a880cd9eda45ffa8e561840954a3b0735fda3b0 t/test_parsing/n_string_incomplete_surrogate_escape_invalid.json
SHA256 1c1ef70149258ff7ee082817269431c45e34f75a2268c3dff56f35d3a4859f1e t/test_parsing/n_string_invalid-utf-8-in-escape.json
SHA256 670eca29fffa63a17bb2e87e1157d473bb3b1a2a3e97aab641f53da93d8bde27 t/test_parsing/n_string_invalid_backslash_esc.json
SHA256 2b6de004085a3dae0ea9b31230c1d9ce7bc92722914eee188d45eeda803c398a t/test_parsing/n_string_invalid_unicode_escape.json
SHA256 d7e1fd6f762f8c56a677954609ede1f15b518a9dd565a719f7841ed6b3e3836a t/test_parsing/n_string_invalid_utf-8.json
SHA256 37d5eedb25cec736cf89a65e86d7c410ce5125e8685a87fb2a276dbccab5ff45 t/test_parsing/n_string_invalid_utf8_after_escape.json
SHA256 63cb55c1bfc4cc630ed56d854519e04e34a1a85f7ca338a90ff4a0bf900250c8 t/test_parsing/n_string_iso_latin_1.json
SHA256 086051c6d14b7dcf7ba3a0a2823fbb9d96ac8e215a7248640bf55ebce77e66c2 t/test_parsing/n_string_leading_uescaped_thinspace.json
SHA256 59de3a862e298c811bf5c494f43104af9c72e0d1c8ee2c2d4ceed7232e9ebe10 t/test_parsing/n_string_lone_utf8_continuation_byte.json
SHA256 814a698775017816f2280a649b3f4e824359c4100225294eb5857e244a248d02 t/test_parsing/n_string_no_quotes_with_bad_escape.json
SHA256 e17aa42df055ec15b4c3118c8e739fe18a52a047c5a2dc36b5ad1df9bb51aeaf t/test_parsing/n_string_overlong_sequence_2_bytes.json
SHA256 ddb01e68ad635d951563550ed51179f064f534cd0d5f26cf8ca26a69a8299bb1 t/test_parsing/n_string_overlong_sequence_6_bytes.json
SHA256 8a6e9429a50beda59e50476ad58c0b18297522149b12deeabaa1acb201e94857 t/test_parsing/n_string_overlong_sequence_6_bytes_null.json
SHA256 8a331fdde7032f33a71e1b2e257d80166e348e00fcb17914f48bdb57a1c63007 t/test_parsing/n_string_single_doublequote.json
SHA256 0389d0d5920ee2996811974bdcbfe05c9ca0ed79af909704b8485bc86f6eaf25 t/test_parsing/n_string_single_quote.json
SHA256 ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad t/test_parsing/n_string_single_string_no_double_quotes.json
SHA256 71efe1dd33978d346960b810a8dd22b9bbca77490b3c35d16ae329f457aea737 t/test_parsing/n_string_start_escape_unclosed.json
SHA256 c85db33857913bc4c4d4f044c72cd06d50ffb5644b2e5093ef8b46ebfe340ed0 t/test_parsing/n_string_unescaped_crtl_char.json
SHA256 b53a55c51fa3b643f1e760d7a2a98869e9bff4e59edff443a632864c37c29e25 t/test_parsing/n_string_unescaped_newline.json
SHA256 f69aad8a6518ca6367a55724dfdc6eace3e202b9035e1f85eab97e3c1495fd2e t/test_parsing/n_string_unescaped_tab.json
SHA256 2871101babb06b63ad8cf90cc9c4b49d52f79d7165db60af743cf42391fae7d2 t/test_parsing/n_string_unicode_CapitalU.json
SHA256 3861f42f224ea26ea00ff20a8a4fba07e3fb26be247c112cf51f4d9840805616 t/test_parsing/n_string_with_trailing_garbage.json
SHA256 13f86ea1e7edd116d18d4ba6c6fa114cd3c927516182d24259623874955d21d1 t/test_parsing/n_structure_100000_opening_arrays.json
SHA256 aacc3ed19ba1f9596daefc68914fe3253c00703648e8ee606f03823feaed1da6 t/test_parsing/n_structure_U+2060_word_joined.json
SHA256 f1945cd6c19e56b3c1c78943ef5ec18116907a4ca1efc40a57d48ab1db7adfc5 t/test_parsing/n_structure_UTF8_BOM_no_data.json
SHA256 4a0aa4da859bc84269fc36c50a5968cf4109b9b07099c0cb49f331f50c5c848b t/test_parsing/n_structure_array_trailing_garbage.json
SHA256 f9bfc9cf84e12516f67e02e9b412520c6ffd0a016730e1da2b5ae32417f8affb t/test_parsing/n_structure_array_with_extra_array_close.json
SHA256 7d5c01400b39d5ebebb81a2a51ec727d9fbf722bbf5caff62cb695c4fb288e29 t/test_parsing/n_structure_array_with_unclosed_string.json
SHA256 c9e0bfc2ef7439ecd1084b7496f1b96ec27e1c8a80c7811eb7f91d4fa64da666 t/test_parsing/n_structure_ascii-unicode-identifier.json
SHA256 b78c88a26a2b512a2964fc4160ddb4d32e2aed8b01219ab5e3666b633572b336 t/test_parsing/n_structure_capitalized_True.json
SHA256 892491211326600b77f0464218fe38f041857e6b8cb5253558f03fe6f81ce40b t/test_parsing/n_structure_close_unopened_array.json
SHA256 d2b042da0c0664285a8485eec9097afc54e376f1a675818386699c5f2a65433d t/test_parsing/n_structure_comma_instead_of_closing_brace.json
SHA256 821bf06b4dcb406ea508a4a992eadc22f29850cd208ba24aea7c29148de8ccf1 t/test_parsing/n_structure_double_array.json
SHA256 cfae0d4248f7142f7b17f826cd7a519280e312577690e957830d23dcf35a3fff t/test_parsing/n_structure_end_array.json
SHA256 3f801979daa8eb44ebbc793bafe85ec1dd22ca8c976d9069fb0b0195c1cad8f9 t/test_parsing/n_structure_incomplete_UTF8_BOM.json
SHA256 ab61ba11a38b007ff98baa3ab20e2a584e15269fd428db3c857e2a2d568b5725 t/test_parsing/n_structure_lone-invalid-utf-8.json
SHA256 245843abef9e72e7efac30138a994bf6301e7e1d7d7042a33d42e863d2638811 t/test_parsing/n_structure_lone-open-bracket.json
SHA256 5545c186e2e58097f78948f4318b1da4a944853d7aa5d431db0a7cc14328ea23 t/test_parsing/n_structure_lt.gt.json
SHA256 7227cd2265406dc197d250c3f0e5293cee7912acad093392367d8679b221f41d t/test_parsing/n_structure_ltnullgt.json
SHA256 59926679fdeb977ce6a3a45683a7aaf2b1d30d4f4f68435df075bbf195843c00 t/test_parsing/n_structure_open_open.json
SHA256 de2e331d891ae267a7009cb45b4e8830f170e0c937288ea2731a1941c7a53b0d t/test_parsing/n_structure_single_point.json
SHA256 684888c0ebb17f374298b65ee2807526c066094c701bcc7ebbe1c1095f494fc1 t/test_parsing/n_structure_single_star.json
SHA256 ce6bcb6a186a600809549525a2aebae9873e6daf4b5eb08c2b88aaa3c9afe449 t/test_parsing/n_structure_trailing_#.json
SHA256 0d3066fc4d2e4da78f549fd8cbc4e9d26abf100c209f116f58e1fc278f0b274f t/test_parsing/n_structure_uescaped_LF_before_string.json
SHA256 4138c6ae42992f3ca53610b0c858e0f5a5a8d7e3424a81feb73b89f0f1877ba9 t/test_parsing/n_structure_unclosed_array.json
SHA256 8a244a1a3fc93637d90f1ec6e3df8bb39fdf0658bc1c55f68cf1c3e38d971e05 t/test_parsing/n_structure_unclosed_array_partial_null.json
SHA256 eed9cbf6e6793bd31aaf13a66d2d21b8af7ee6574be5ce70b991249d651c515f t/test_parsing/n_structure_unclosed_array_unfinished_false.json
SHA256 6732ae91c3a7dd2d74828f2683d8a7b084e2f4d003fef7c42fd0e01b81e1dd39 t/test_parsing/n_structure_unclosed_array_unfinished_true.json
SHA256 6ee07337d690f359cd72160b7345984cc14d987e24d588a8433f257d2336ce49 t/test_parsing/n_structure_unclosed_object.json
SHA256 e83979df9d36090142f23051f8e8d7ad48e5c20dff5c9e7b92ca3454f67469f9 t/test_parsing/n_structure_unicode-identifier.json
SHA256 aacc3ed19ba1f9596daefc68914fe3253c00703648e8ee606f03823feaed1da6 t/test_parsing/n_structure_whitespace_U+2060_word_joiner.json
SHA256 3102771b514935404e59053582c064b415c54e08f92d229ea1d539364698b952 t/test_parsing/n_structure_whitespace_formfeed.json
SHA256 03514ff57dd2364cc63b23ff011cc97cdc0aee89e31f39b538c45efa4a1f093b t/test_parsing/y_array_arraysWithSpaces.json
SHA256 055539df4a0b804c58caf46c0cd2941af10d64c1395ddd8e50b5f55d945841e6 t/test_parsing/y_array_empty-string.json
SHA256 4f53cda18c2baa0c0354bb5f9a3ecbe5ed12ab4d8e11ba873c2f11161202b945 t/test_parsing/y_array_empty.json
SHA256 0eb5b8d6f81bc677da8a08567cc4fa9a06a57e9ec8da85ed73a7f62727996002 t/test_parsing/y_array_ending_with_newline.json
SHA256 456e2e3fa05ee1e2f4e529558008ce162bbd388a9dd4a923c79543a4a1dba618 t/test_parsing/y_array_false.json
SHA256 14c644de0d447c3a875fcb1a257cc09a5db3ef047377733066ffc1bee4a17803 t/test_parsing/y_array_heterogeneous.json
SHA256 1d8fc6ceb1f94c6326d6d5483d258fcb2e179e9869325b245d105c2219bf69fd t/test_parsing/y_array_null.json
SHA256 f86600a2874fa2ef13591457f10987e1e511915b75c042e6aefc004ec21db598 t/test_parsing/y_array_with_1_and_newline.json
SHA256 2d2df3a9238ce3d7ee68794dafbca7439308cc9abc685806ab8d80e3f7e6c5a2 t/test_parsing/y_object.json
SHA256 aeab10e350ec1756ea24bc72181b19979e86c9585ced7b89e8a657e75d239c22 t/test_parsing/y_object_basic.json
SHA256 94766ff02436ccd9bceddab5ed15bd3df3d5d6cee3ca0a34c9ad1fd1a9bed523 t/test_parsing/y_object_duplicated_key.json
SHA256 d89b7a808458bca34b53d4731a66402ad3731942e4a5da221a1ac9be564e4235 t/test_parsing/y_object_duplicated_key_and_value.json
SHA256 44136fa355b3678a1146ad16f7e8649e94fb4fc21fe77e8310c060f61caaff8a t/test_parsing/y_object_empty.json
SHA256 6d741b146801696dd35e34575e778730f06b2ec4bb5ccee13166f36c0761a55a t/test_parsing/y_object_empty_key.json
SHA256 1c3c00c78ceca5a6cce2f0aefe316b5352117011f6f9a471a18eb4f3c1930739 t/test_parsing/y_object_escaped_null_in_key.json
SHA256 a46f36a13a1bb69b26785a2a7a7999cd4ea9d19c6ee4fb4cd6a0ab2451ee06ba t/test_parsing/y_object_extreme_numbers.json
SHA256 b7afdd9d8feae8fc6a4532b01bddea0691994e8ed7e4a93303157c83413d156d t/test_parsing/y_object_long_strings.json
SHA256 50e8660084976a10f0b3b9b3a6352d5881cbd219b5587a26224971a60ff2cc55 t/test_parsing/y_object_simple.json
SHA256 edec7a6f5af644b0b729f4c822d60dc74575dfa11157fc6e6a855150d286aad8 t/test_parsing/y_object_string_unicode.json
SHA256 27e0a21606c52d12b7eacb1ec1cb18dfeb847077ad5dfa229af81ce9694065aa t/test_parsing/y_object_with_newlines.json
SHA256 b9f5b15f84663a920e537ad55693aa2c6aab6b8e499c6187f54116b8a78800d5 t/test_parsing/y_string_1_2_3_bytes_UTF-8_sequences.json
SHA256 fe59c5b3de3b68f7c7fb803299e2bcf5b280a45c2fca2ab2cb2391d8024e3dea t/test_parsing/y_string_UTF-16_Surrogates_U+1D11E_MUSICAL_SYMBOL_G_CLEF.json
SHA256 112c1de300c75efe3328e044b785388e1adaa1a4d11d05b04c4f8c20758ddba2 t/test_parsing/y_string_accepted_surrogate_pair.json
SHA256 9df10c47273a7e385c87007e8629b34a30288eb24752c9e1c519256b46d6e287 t/test_parsing/y_string_accepted_surrogate_pairs.json
SHA256 8eb4cce67d4f8e6d61a3e719f6910d3b770cf7493a95f85c33c503b57506263e t/test_parsing/y_string_allowed_escapes.json
SHA256 b53b019aabe34fa44bb6b82c3094665572dbec4f673c56ccf539480ad769d931 t/test_parsing/y_string_backslash_and_u_escaped_zero.json
SHA256 f3e471a47b03bdaf13bbd20b97f5490974eedb5a8b45763c8164f9d6255339dd t/test_parsing/y_string_backslash_doublequotes.json
SHA256 82b15308414d192008b8f6f1463a5438dba9b64ba529e0171dce571a4d7a9450 t/test_parsing/y_string_comments.json
SHA256 ea5f706e0e55ac56444147f4e7b2252c1501a8362ca150d2735e47f4be4746c2 t/test_parsing/y_string_double_escape_a.json
SHA256 440a346596ed50e35bd72fb0bba49b20c67bccf8899ae5ef1d73890f40e9593e t/test_parsing/y_string_one-byte-utf-8.json
SHA256 60373866a7dbaf4c8e7dc2b6428d8ac337331bd758ecdbeb27d6cd0eb3e9f8b4 t/test_parsing/y_string_pi.json
SHA256 a7ad412f8443140eae23fb4129c10c147bb81a17c76111803be58b7eeb1bbeb7 t/test_parsing/y_string_simple_ascii.json
SHA256 52109349dabf69106e04ec2f493fb8b6ade94ea100227cccce6559ab8b96553f t/test_parsing/y_string_space.json
SHA256 eb3da7d2b738cd455a444490897d290a8a89cf3830a0443bd32a319854882926 t/test_parsing/y_string_three-byte-utf-8.json
SHA256 92a4c4eff0bf782553cc5f0309c56fc8e1cd749d98756df3b47400e016558550 t/test_parsing/y_string_two-byte-utf-8.json
SHA256 7cf97fa4811058a28bcd46d0a8a829c52b3577451e88bd32a2ba711905112273 t/test_parsing/y_string_u+2028_line_sep.json
SHA256 bd532d486bbb87075166aa0ac00c967ba019ed58e603ed644f0b1c099ba262f5 t/test_parsing/y_string_u+2029_par_sep.json
SHA256 a69c93369dd5e8e3f07db70b9110f59998fab55c1d8eac6a37ecebed3d1f8516 t/test_parsing/y_string_uEscape.json
SHA256 2366f354a28f19c40b4994ae5a341137807c954180c52cbc9d56a75722dcdeed t/test_parsing/y_string_unescaped_char_delete.json
SHA256 3db3f981f8e96028e601cae9bd8098852df6cc1b751b9c4ed56a2f2df85b7d98 t/test_parsing/y_string_unicode.json
SHA256 f791a3c18024a7dec0d9dc92d7cf9ac8f2100409e1c5f196d510fa543195c787 t/test_parsing/y_string_unicodeEscapedBackslash.json
SHA256 a44e2ecefdcc43bfea052cc63fd8e02348e1bf50640b7f50919db3d02c3bd05a t/test_parsing/y_string_unicode_2.json
SHA256 1deed1d5984a8e96e6901eb3cbbe3516611459ff622136ec47181e33e604a598 t/test_parsing/y_string_unicode_U+200B_ZERO_WIDTH_SPACE.json
SHA256 7312cf1ea2ada2cebd1a374504dc14232e877ac58fff149ec61dca0d7bda4775 t/test_parsing/y_string_unicode_U+2064_invisible_plus.json
SHA256 0cd3133261a2fa55220280b49f19b46f59bbc5f0298f00c1bb3470125b58ff8d t/test_parsing/y_string_unicode_escaped_double_quote.json
SHA256 6a9c15ecc8fc3da72b0ba5e3539e07f2aad3c704b496fe3496579dc723ce49c5 t/test_parsing/y_string_utf16.json
SHA256 10456d2173d5a0d5901d5f9af24dc96c506d3d4448f3abecb68a0ab13055570e t/test_parsing/y_string_utf16be.json
SHA256 245d405df71533adcb80208c01c214ef0711f2f8564db8e0a86694964e40ff22 t/test_parsing/y_string_utf32.json
SHA256 86cdd13e02c5aba17fab9eea22cc6e7fde64469ad150b01e4ae0032513347895 t/test_parsing/y_string_utf32be.json
SHA256 adec79032c3509dce21c9b0b96445a0fe398533d6647d12abc639eef16e621ab t/test_parsing/y_string_utf8.json
SHA256 db99989c39740edd8dda79380e881f7d0837fb88481dafa65dd5cfaee0038fdf t/test_parsing/y_string_with_del_character.json
SHA256 fcbcf165908dd18a9e49f7ff27810176db8e9f63b4352213741664245224f8aa t/test_parsing/y_structure_lonely_false.json
SHA256 73475cb40a568e8da8a045ced110137e159f890ac4da883b6b17dc651b3a8049 t/test_parsing/y_structure_lonely_int.json
SHA256 ffe616e28103a848cc8a18531f5ba096e153b50c6d597297ad5cb69e39496f6a t/test_parsing/y_structure_lonely_negative_real.json
SHA256 74234e98afe7498fb5daf1f36ac2d78acc339464f950703b8c019892f982b90b t/test_parsing/y_structure_lonely_null.json
# exported functions, they croak on error
# and expect/generate UTF-8
$utf8_encoded_json_text = encode_json $perl_hash_or_arrayref;
$perl_hash_or_arrayref = decode_json $utf8_encoded_json_text;
# OO-interface
$coder = Cpanel::JSON::XS->new->ascii->pretty->allow_nonref;
$pretty_printed_unencoded = $coder->encode ($perl_scalar);
$perl_scalar = $coder->decode ($unicode_json_text);
# Note that 5.6 misses most smart utf8 and encoding functionalities
# of newer releases.
# Note that L<JSON::MaybeXS> will automatically use Cpanel::JSON::XS
# if available, at virtually no speed overhead either, so you should
# be able to just:
use JSON::MaybeXS;
because internally it's now a NOK type. However !!1 which is
wrongly encoded in 5.8 as "1"/1.0 is still represented as integer.
- different handling of inf/nan. Default now to null, optionally with
stringify_infnan() to "inf"/"nan". [#28, #32]
- added C<binary> extension, non-JSON and non JSON parsable, allows
C<\xNN> and C<\NNN> sequences.
- 5.6.2 support; sacrificing some utf8 features (assuming bytes
all-over), no multi-byte unicode characters with 5.6.
- interop for true/false overloading. JSON::XS, JSON::PP and Mojo::JSON
representations for booleans are accepted and JSON::XS accepts
Cpanel::JSON::XS booleans [#13, #37]
Fixed overloading of booleans. Cpanel::JSON::XS::true stringifies again
to "1", not "true", analog to all other JSON modules.
- native boolean mapping of yes and no to true and false, as in YAML::XS.
In perl C<!0> is yes, C<!1> is no.
The JSON value true maps to 1, false maps to 0. [#39]
- #7, #29 avoid re-blessing where possible. It fails in JSON::XS for
READONLY values, i.e. restricted hashes.
- #41 overloading of booleans, use the object not the reference.
- #62 -Dusequadmath conversion and no SEGV.
- #72 parsing of values followed \0, like 1\0 does fail.
- #72 parsing of illegal unicode or non-unicode characters.
- #96 locale-insensitive numeric conversion.
- #154 numeric conversion fixed since 5.22, using the same strtold as perl5.
- #167 sort tied hashes with canonical.
- #212 fix utf8 object stringification
- public maintenance and bugtracker
tests. In fact it is the only know JSON decoder which does so,
while also being the fastest.
- support many more options and methods from JSON::PP:
stringify_infnan, allow_unknown, allow_stringify, allow_barekey,
encode_stringify, allow_bignum, allow_singlequote, dupkeys_as_arrayref,
sort_by (partially), escape_slash, convert_blessed, ...
optional decode_json(, allow_nonref) arg.
relaxed implements allow_dupkeys.
- support all 5 unicode L<BOM|/BOM>'s: UTF-8, UTF-16LE, UTF-16BE, UTF-32LE,
UTF-32BE, encoding internally to UTF-8.
=cut
our @ISA = qw(Exporter);
our @EXPORT = qw(encode_json decode_json to_json from_json);
sub to_json($@) {
if ($] >= 5.008) {
require Carp;
If you have UTF-8 encoded data, it is no longer a Unicode string, but
a Unicode string encoded in UTF-8, giving you a binary string.
=item 5. A string containing "high" (> 255) character values is I<not>
a UTF-8 string.
=item 6. Raw non-Unicode characters below U+10FFFF are allowed.
The 66 Unicode noncharacters U+FDD0..U+FDEF, and U+*FFFE, U+*FFFF are
allowed without warning, as JSON::PP does, see
L<http://www.unicode.org/versions/corrigendum9.html>. But illegal
surrogate pairs fail to parse.
=item 7. Raw non-Unicode characters above U+10FFFF are disallowed.
Raw non-Unicode characters outside the valid unicode range fail to
parse, because "A string is a sequence of zero or more Unicode
characters" RFC 7159 section 1 and "JSON text SHALL be encoded in
Unicode RFC 7159 section 8.1. We use now the UTF8_DISALLOW_SUPER
flag when parsing unicode.
=item 8. Lone surrogates or illegal surrogate pairs are disallowed.
Since RFC 3629, U+D800 through U+DFFF are not legal Unicode values and
their UTF-8 encodings must be treated as an invalid byte sequence.
RFC 8259 section 8.2 admits the spec allows string values that contain
bit sequences that cannot encode Unicode characters and that the
behavior of software that receives such values is unpredictable. To
avoid introducing non-Unicode strings into Perl we use the
UTF8_DISALLOW_SURROGATE flag when parsing Unicode and verify escaped
new C<\xNN> sequences, which is B<unparsable JSON>. The C<decode>
method forbids C<\uNNNN> sequences and accepts C<\xNN> and octal
C<\NNN> sequences.
There is also a special logic for perl 5.6 and utf8. 5.6 encodes any
string to utf-8 automatically when seeing a codepoint >= C<0x80> and
< C<0x100>. With the binary flag enabled decode the perl utf8 encoded
string to the original byte encoding and encode this with C<\xNN>
escapes. This will result to the same encodings as with newer
perls. But note that binary multi-byte codepoints with 5.6 will
result in C<illegal unicode character in binary string> errors,
unlike with newer perls.
If C<$enable> is false, then the C<encode> method will smartly try to
detect Unicode characters unless required by the JSON syntax or other
flags and hex and octal sequences are forbidden.
See also the section I<ENCODING/CODESET FLAG NOTES> later in this
document.
The main use for this flag is to avoid the smart unicode detection and
possible double encoding. The disadvantage is that the resulting JSON
text is encoded in new C<\xNN> and in latin1 characters and must
correctly be treated as such when storing and transferring, a rare
encoding for JSON. It will produce non-readable JSON strings in the
browser. It is therefore most useful when you want to store data
structures known to contain binary data efficiently in files or
databases, not when talking to other JSON encoders/decoders. The
binary decoding method can also be used when an encoder produced a
non-JSON conformant hex or octal encoding C<\xNN> or C<\NNN>.
Cpanel::JSON::XS->new->binary->encode (["\x{89}\x{abc}"])
5.6: Error: malformed or illegal unicode character in binary string
>=5.8: ['\x89\xe0\xaa\xbc']
Cpanel::JSON::XS->new->binary->encode (["\x{89}\x{bc}"])
=> ["\x89\xbc"]
Cpanel::JSON::XS->new->binary->decode (["\x89\ua001"])
Error: malformed or illegal unicode character in binary string
Cpanel::JSON::XS->new->decode (["\x89"])
Error: illegal hex character in non-binary string
=item $json = $json->utf8 ([$enable])
=item $enabled = $json->get_utf8
If C<$enable> is true (or missing), then the C<encode> method will encode
or die "read error: $!";
$json->incr_parse ($buf); # void context, so no parsing
}
This is a complex example, but most of the complexity comes from the fact
that we are trying to be correct (bear with me if I am wrong, I never ran
the above example :).
=head1 BOM
Detect all unicode B<Byte Order Marks> on decode.
Which are UTF-8, UTF-16LE, UTF-16BE, UTF-32LE and UTF-32BE.
The BOM encoding is set only for one specific decode call, it does not
change the state of the JSON object.
B<Warning>: With perls older than 5.20 you need load the Encode module
before loading a multibyte BOM, i.e. >= UTF-16. Otherwise an error is
thrown. This is an implementation limitation and might get fixed later.
See L<https://tools.ietf.org/html/rfc7159#section-8.1>
I<"JSON text SHALL be encoded in UTF-8, UTF-16, or UTF-32.">
I<"Implementations MUST NOT add a byte order mark to the beginning of a
JSON text", "implementations (...) MAY ignore the presence of a byte
order mark rather than treating it as an error".>
See also L<http://www.unicode.org/faq/utf_bom.html#BOM>.
Beware that Cpanel::JSON::XS is currently the only JSON module which
does accept and decode a BOM.
The latest JSON spec
L<https://www.greenbytes.de/tech/webdav/rfc8259.html#character.encoding>
forbid the usage of UTF-16 or UTF-32, the character encoding is UTF-8.
Thus in subsequent updates BOM's of UTF-16 or UTF-32 will throw an error.
=head1 MAPPING
C<__proto__> property name for its own purposes.
If that is a problem, you could parse try to filter the resulting JSON
output for these property strings, e.g.:
$json =~ s/"__proto__"\s*:/"__proto__renamed":/g;
This works because C<__proto__> is not valid outside of strings, so every
occurrence of C<"__proto__"\s*:> must be a string used as property name.
Raw non-Unicode characters outside the valid unicode range fail now to
parse, because "A string is a sequence of zero or more Unicode
characters" RFC 7159 section 1 and "JSON text SHALL be encoded in
Unicode RFC 7159 section 8.1. We use now the UTF8_DISALLOW_SUPER
flag when parsing unicode.
Since RFC 3629, U+D800 through U+DFFF are not legal Unicode values and
their UTF-8 encodings must be treated as an invalid byte sequence.
RFC 8259 section 8.2 admits the spec allows string values that contain
bit sequences that cannot encode Unicode characters and that the
behavior of software that receives such values is unpredictable. To
avoid introducing non-Unicode strings into Perl we use the
UTF8_DISALLOW_SURROGATE flag when parsing Unicode and verify escaped
surrogates form valid pairs.
decode_utf8 (pTHX_ unsigned char *s, STRLEN len, int relaxed, STRLEN *clen)
{
if (LIKELY(len >= 2
&& IN_RANGE_INC (char, s[0], 0xc2, 0xdf)
&& IN_RANGE_INC (char, s[1], 0x80, 0xbf)))
{
*clen = 2;
return ((s[0] & 0x1f) << 6) | (s[1] & 0x3f);
}
else {
/* Since perl 5.14 we can disallow surrogates and illegal unicode above
U+10FFFF.
Before we could only warn with warnings 'utf8'.
Surrogates are never allowed for consistency with unpaired escaped surrogate
handling.
SUPER, above U+10FFFF is not allowed, unless we are in the relaxed mode.
*/
#if PERL_VERSION > 36
UV c = utf8n_to_uvchr (s, len, clen,
UTF8_CHECK_ONLY | UTF8_DISALLOW_SURROGATE | (relaxed ? 0 : UTF8_DISALLOW_SUPER));
#elif PERL_VERSION > 12
#endif
#if PERL_VERSION >= 8
return c;
#else
/* 5.6 does not detect certain ill-formed sequences, esp. overflows,
which are security relevant. so we add code to detect these. */
UV c = utf8_to_uv(s, len, clen, UTF8_CHECK_ONLY);
if (!relaxed) {
if (!c || c > PERL_UNICODE_MAX)
*clen = -1;
/* need to check manually for some overflows. 5.6 unicode bug */
else if (len >= 2
&& IN_RANGE_INC (char, s[0], 0xc0, 0xfe)
&& !IN_RANGE_INC (char, s[0], 0xc2, 0xdf)) {
U8 *s0, *send;
UV uv = *s;
UV expectlen = UTF8SKIP(s);
#define UTF_CONTINUATION_MASK ((U8) ((1U << 6) - 1))
#define UTF_ACCUMULATION_OVERFLOW_MASK \
(((UV) UTF_CONTINUATION_MASK) << ((sizeof(UV) * 8) - 6))
encode_str (pTHX_ enc_t *enc, char *str, STRLEN len, int is_utf8)
{
char *end = str + len;
#if PERL_VERSION < 8
/* perl5.6 encodes to utf8 automatically, reverse it */
if (is_utf8 && (enc->json.flags & F_BINARY))
{
str = (char *)utf8_to_bytes((U8*)str, &len);
if (!str)
croak ("illegal unicode character in binary string", str);
end = str + len;
}
#endif
need (aTHX_ enc, len);
while (str < end)
{
unsigned char ch = *(unsigned char *)str;
#if PERL_VERSION > 8 || (PERL_VERSION == 8 && PERL_SUBVERSION >= 1)
DEBUG_v(Perl_deb(aTHX_ "str enc: %p %p %4ld, want: %lu\n", enc->cur, enc->end,
default:
{
STRLEN clen;
UV uch;
if (is_utf8 && !(enc->json.flags & F_BINARY))
{
uch = decode_utf8 (aTHX_ (unsigned char *)str, end - str,
enc->json.flags & F_RELAXED, &clen);
if (clen == (STRLEN)-1)
croak ("malformed or illegal unicode character in string [%.11s], cannot convert to JSON", str);
}
else
{
uch = ch;
clen = 1;
}
if (uch < 0x80/*0x20*/ || uch >= enc->limit)
{
if (enc->json.flags & F_BINARY)
{
UV lo, hi;
++dec_cur;
dec->cur = dec_cur;
hi = decode_4hex (dec);
dec_cur = dec->cur;
if (hi == (UV)-1)
goto fail;
if (dec->json.flags & F_BINARY)
ERR ("illegal unicode character in binary string");
/* possibly a surrogate pair */
if (hi >= 0xd800) {
if (hi < 0xdc00) {
if (dec_cur [0] != '\\' || dec_cur [1] != 'u')
ERR ("missing low surrogate character in surrogate pair");
dec_cur += 2;
dec->cur = dec_cur;
}
}
else if (UNLIKELY(hi < 0xe000)) {
ERR ("missing high surrogate character in surrogate pair");
}
else
/* check 66 noncharacters U+FDD0..U+FDEF, U+FFFE, U+FFFF
and U+1FFFE, U+1FFFF, U+2FFFE, U+2FFFF, ... U+10FFFE, U+10FFFF (issue #74)
and warn as in core.
See http://www.unicode.org/versions/corrigendum9.html.
https://www.rfc-editor.org/errata_search.php?rfc=7159&eid=3984
The WG's consensus was to leave the full range present
in the ABNF and add the interoperability guidance about
values outside the Unicode accepted range.
*/
if (UNLIKELY(
!(dec->json.flags & F_RELAXED)
&& ((hi >= 0xfdd0 && hi <= 0xfdef)
|| (hi >= 0xfffe && hi <= 0xffff)))) {
parse_fullexpr||5.013008|
parse_fullstmt||5.013005|
parse_gv_stash_name|||
parse_ident|||
parse_label||5.013007|
parse_listexpr||5.013008|
parse_lparen_question_flags|||
parse_stmtseq||5.013006|
parse_subsignature|||
parse_termexpr||5.013008|
parse_unicode_opts|||
parser_dup|||
parser_free_nexttoke_ops|||
parser_free|||
path_is_searchable|||n
peep|||
pending_ident|||
perl_alloc_using|||n
perl_alloc|||n
perl_clone_using|||n
perl_clone|||n
#endif
#ifndef PERL_PV_PRETTY_DUMP
# define PERL_PV_PRETTY_DUMP PERL_PV_PRETTY_ELLIPSES|PERL_PV_PRETTY_QUOTE
#endif
#ifndef PERL_PV_PRETTY_REGPROP
# define PERL_PV_PRETTY_REGPROP PERL_PV_PRETTY_ELLIPSES|PERL_PV_PRETTY_LTGT|PERL_PV_ESCAPE_RE
#endif
/* Hint: pv_escape
* Note that unicode functionality is only backported to
* those perl versions that support it. For older perl
* versions, the implementation will fall back to bytes.
*/
#ifndef pv_escape
#if defined(NEED_pv_escape)
static char * DPPP_(my_pv_escape)(pTHX_ SV * dsv, char const * const str, const STRLEN count, const STRLEN max, STRLEN * const escaped, const U32 flags);
static
#else
extern char * DPPP_(my_pv_escape)(pTHX_ SV * dsv, char const * const str, const STRLEN count, const STRLEN max, STRLEN * const escaped, const U32 flags);
t/01_utf8.t view on Meta::CPAN
is(Cpanel::JSON::XS->new->allow_nonref->decode('"\"\n\\\\\r\t\f\b"'), "\"\012\\\015\011\014\010");
my $utf8_love = "I \342\235\244 perl";
is(Cpanel::JSON::XS->new->ascii->encode([$utf8_love]), '["I \u00e2\u009d\u00a4 perl"]', 'utf8 enc ascii');
is(Cpanel::JSON::XS->new->latin1->encode([$utf8_love]), "[\"I \342\235\244 perl\"]", 'utf8 enc latin1');
is(Cpanel::JSON::XS->new->utf8->encode([$utf8_love]), "[\"I \303\242\302\235\302\244 perl\"]", 'utf8 enc utf8');
is(Cpanel::JSON::XS->new->binary->encode([$utf8_love]), '["I \xe2\x9d\xa4 perl"]', 'utf8 enc binary');
SKIP: {
skip "5.6", 4 if $] < 5.008;
my $unicode_love = "I ⤠perl";
is(Cpanel::JSON::XS->new->ascii->encode([$unicode_love]), '["I \u2764 perl"]', 'unicode enc ascii');
is(Cpanel::JSON::XS->new->latin1->encode([$unicode_love]), "[\"I \\u2764 perl\"]", 'unicode enc latin1');
is(Cpanel::JSON::XS->new->utf8->encode([$unicode_love]), "[\"I \342\235\244 perl\"]", 'unicode enc utf8');
is(Cpanel::JSON::XS->new->binary->encode([$unicode_love]), '["I \xe2\x9d\xa4 perl"]', 'unicode enc binary');
}
# TODO: test utf8 hash keys,
# test utf8 strings without any char > 0x80.
# security exploits via ill-formed subsequences
# see http://unicode.org/reports/tr36/#UTF-8_Exploit
# testcases from Encode/t/utf8strict.t
# All these sequences are not handled by the unsafe, fast XS decoder,
# rather passed through to the safe Perl decoder, which detects those.
my @ill =
(# http://smontagu.damowmow.com/utf8test.html
# The numbers below, like 2.1.2 are test numbers on this web page
qq/80/ , # 3.1.1
qq/bf/ , # 3.1.2
qq/80 bf/ , # 3.1.3
qq/80 bf 80/ , # 3.1.4
t/108_decode.t view on Meta::CPAN
#
# decode on Perl 5.005, 5.6, 5.8 or later
#
use strict;
use Test::More tests => 11;
use Cpanel::JSON::XS;
use lib qw(t);
use _unicode_handling;
no utf8;
my $json = Cpanel::JSON::XS->new->allow_nonref;
SKIP: {
skip "5.6", 1 if $] < 5.008;
is($json->decode(q|"ü"|), "ü"); # utf8
}
is($json->decode(q|"\u00fc"|), "\xfc"); # latin1
is($json->decode(q|"\u00c3\u00bc"|), "\xc3\xbc"); # utf8
t/109_encode.t view on Meta::CPAN
#
# decode on Perl 5.005, 5.6, 5.8 or later
#
use strict;
use Test::More tests => 7;
use Cpanel::JSON::XS;
BEGIN {
use lib qw(t);
use _unicode_handling;
}
no utf8;
my $json = Cpanel::JSON::XS->new->allow_nonref;
is($json->encode("ü"), q|"ü"|); # as is
$json->ascii;
t/112_upgrade.t view on Meta::CPAN
use strict;
use Test::More tests => 3;
use Cpanel::JSON::XS;
BEGIN {
use lib qw(t);
use _unicode_handling;
}
my $json = Cpanel::JSON::XS->new->allow_nonref->utf8;
my $str = '\\u00c8';
my $value = $json->decode( '"\\u00c8"' );
#use Devel::Peek;
#Dump( $value );
t/30_jsonspec.t view on Meta::CPAN
use Test::More ($] >= 5.008) ? (tests => 678) : (skip_all => "needs 5.8");
use Cpanel::JSON::XS;
BEGIN {
require Encode if $] >= 5.008 && $] < 5.020; # Currently required for <5.20
}
my $json = Cpanel::JSON::XS->new->utf8->allow_nonref;
my $relaxed = Cpanel::JSON::XS->new->utf8->allow_nonref->relaxed;
# fixme:
# done:
# i_string_unicode_*_nonchar ["\uDBFF\uDFFE"] (add warning as in core)
# i_string_not_in_unicode_range Code point 0x13FFFF is not Unicode UTF8_DISALLOW_SUPER
# y_string_utf16, y_string_utf16be, y_string_utf32, y_string_utf32be fixed with 3.0222
# n_string_UTF8_surrogate_U+D800 Code point 0xD800 is not Unicode UTF8_DISALLOW_SURROGATE
my %todo;
$todo{'n_string_UTF8_surrogate_U+D800'}++ if $] < 5.014;
$todo{'y_string_nonCharacterInUTF-8_U+FFFF'}++ if $] < 5.013;
if ($] < 5.008) {
# 5.6 has no multibyte support
$todo{$_}++ for qw(
n_string_overlong_sequence_2_bytes
n_string_overlong_sequence_6_bytes_null
t/30_jsonspec.t view on Meta::CPAN
}
# undefined i_ tests:
# also pass with relaxed
my %i_pass = map{$_ => 1}
qw(
i_number_neg_int_huge_exp
i_number_pos_double_huge_exp
i_structure_500_nested_arrays
i_structure_UTF-8_BOM_empty_object
i_string_unicode_U+10FFFE_nonchar
i_string_unicode_U+1FFFE_nonchar
i_string_unicode_U+FDD0_nonchar
i_string_unicode_U+FFFE_nonchar
);
# should also fail with relaxed, except i_string_not_in_unicode_range
my %i_parseerr = map{$_ => 1}
qw(
i_object_key_lone_2nd_surrogate
i_string_1st_surrogate_but_2nd_missing
i_string_1st_valid_surrogate_2nd_invalid
i_string_incomplete_surrogate_and_escape_valid
i_string_incomplete_surrogate_pair
i_string_incomplete_surrogates_escape_valid
i_string_inverted_surrogates_U+1D11E
i_string_lone_second_surrogate
i_string_truncated-utf-8
i_string_UTF-16_invalid_lonely_surrogate
i_string_UTF-16_invalid_surrogate
i_string_UTF-8_invalid_sequence
i_string_not_in_unicode_range
y_object_duplicated_key
y_object_duplicated_key_and_value
);
# should parse and return undef:
my %i_empty = map{$_ => 1}
qw(
);
# parser need to fail
sub n_error {
t/30_jsonspec.t view on Meta::CPAN
sub i_error {
my ($str, $name) = @_;
$@ = '';
my $result = eval { $json->decode($str) };
TODO: {
local $TODO = "$name" if exists $todo{$name};
isnt($@, '', "parsing error with undefined $name ".substr($@,0,40));
is($result, undef, "no result with undefined $name");
$@ = '';
$result = eval { $relaxed->decode($str) };
if ($name eq 'i_string_not_in_unicode_range') {
is($@, '', "no parsing error with undefined $name relaxed ".substr($@,0,40));
isnt($result, undef, "valid result with undefined $name relaxed");
} else {
isnt($@, '', "parsing error with undefined $name relaxed ".substr($@,0,40));
is($result, undef, "no result with undefined $name relaxed");
}
}
}
# todo: test_transform also
for my $bom (@bom) {
y_pass(@$bom);
}
# [GH #125] BOM in the middle corrupts state, sets utf8 flag
my $j = Cpanel::JSON::XS->new;
ok(my $as_json = eval {
$j->encode({ example => "data with non-ASCII characters",
unicode => "\N{greek:Sigma}" })
}, 'can encode a basic structure');
ok(eval { $j->decode($as_json) }, 'can decode again');
ok(eval { $j->decode("\x{feff}" . $as_json) }, 'can decode with BOM');
ok(eval { $j->decode($as_json) }, 'can decode original');
t/_unicode_handling.pm view on Meta::CPAN
#package utf8;
package _unicode_handling;
# this is a dummy pragma for 5.005.
if ($] < 5.006) {
$INC{'utf8.pm'} = './utf8.pm';
eval q|
sub utf8::import { }
sub utf8::unimport { }
|;
xt/leaktrace.t view on Meta::CPAN
$js->encode ( bless { k => 1 }, Temp1:: );
} '<', 1;
# leak on allow_nonref croak, GH 206
leaks_cmp_ok{
eval { decode_json('"asdf"') };
#print $@;
} '<', 1;
# illegal unicode croak
leaks_cmp_ok{
eval { decode_json("{\"\x{c2}\x{c2}\"}") };
#print $@;
} '<', 1;
# wrong type croak
leaks_cmp_ok{
use Cpanel::JSON::XS::Type;
my $js = Cpanel::JSON::XS->new->canonical->require_types;
eval { $js->encode([0], JSON_TYPE_FLOAT) };
xt/pod-spelling.t view on Meta::CPAN
stringifies
stringifying
superset
syck
testsuite
th
toformat
typeless
un
unblessed
unicode
utf
xs
yaml
( run in 0.712 second using v1.01-cache-2.11-cpan-88abd93f124 )