@@ -362,6 +362,17 @@ characters" RFC 7159 section 1 and "JSON text SHALL be encoded in
362362Unicode RFC 7159 section 8.1. We use now the UTF8_DISALLOW_SUPER
363363flag when parsing unicode.
364364
365+ =item 8. Lone surrogates or illegal surrogate pairs are disallowed.
366+
367+ Since RFC 3629, U+D800 through U+DFFF are not legal Unicode values and
368+ their UTF-8 encodings must be treated as an invalid byte sequence.
369+ RFC 8259 section 8.2 admits the spec allows string values that contain
370+ bit sequences that cannot encode Unicode characters and that the
371+ behavior of software that recieves such values is unpredictable. To
372+ avoid introducing non-Unicode strings into Perl we use the
373+ UTF8_DISALLOW_SURROGATE flag when parsing Unicode and verify escaped
374+ surrogates form valid pairs.
375+
365376=back
366377
367378I hope this helps :)
@@ -1997,6 +2008,15 @@ characters" RFC 7159 section 1 and "JSON text SHALL be encoded in
19972008Unicode RFC 7159 section 8.1. We use now the UTF8_DISALLOW_SUPER
19982009flag when parsing unicode.
19992010
2011+ Since RFC 3629, U+D800 through U+DFFF are not legal Unicode values and
2012+ their UTF-8 encodings must be treated as an invalid byte sequence.
2013+ RFC 8259 section 8.2 admits the spec allows string values that contain
2014+ bit sequences that cannot encode Unicode characters and that the
2015+ behavior of software that recieves such values is unpredictable. To
2016+ avoid introducing non-Unicode strings into Perl we use the
2017+ UTF8_DISALLOW_SURROGATE flag when parsing Unicode and verify escaped
2018+ surrogates form valid pairs.
2019+
20002020If you know of other incompatibilities, please let me know.
20012021
20022022
0 commit comments