mirror of
https://github.com/simdjson/simdjson
synced 2026-06-08 17:27:07 +00:00
5809e51ae4
Closes #1894 Reject low surrogates outside of the range U+DC00—U+DFFF Related to https://unicodebook.readthedocs.io/unicode_encodings.html#utf-16-surrogate-pairs A surrogate pair should consist of a high surrogate and low surrogate. They're used to represent 0x010000-0x10FFFF in the JSON spec because the JavaScript specification originally only supported `\uXXXX`. Previously, simdjson would accept some combinations of valid high surrogates and invalid low surrogates due to a bug in the check. (e.g. `\uD888\u1234` was accepted) U+D800—U+DBFF (1,024 code points): high surrogates U+DC00—U+DFFF (1,024 code points): low surrogates