Subject: | Reject U+D800 to U+DFFF in strings for encoding |
JSON::PP allows to create invalid JSON if a string contains codepoint that are forbidden in Unicode because they are reserved for UTF-16 surrogate pairs: U+D800 to U+DFFF
$ perl -MJSON::PP= -E '$J=JSON::PP->new->ascii->allow_nonref; say $J->decode($J->encode("\N{U+D800}"))'
missing low surrogate character in surrogate pair, at character offset 8 (before "(end of string)") at -e line 1.
--
Olivier Mengué - http://perlresume.org/DOLMEN