Closed xxxbxxx closed 5 years ago
hi!
No, indeed, this is not about supporting utf-16, but dealing with this case:
To escape an extended character that is not in the Basic Multilingual Plane, the character is represented as a twelve-character sequence, encoding the UTF-16 surrogate pair. So, for example, a string containing only the G clef character (U+1D11E) may be represented as "\uD834\uDD1E".
https://tools.ietf.org/id/draft-ietf-json-rfc4627bis-09.html#rfc.section.7
(I not sure there are really any good reasons to want to escape such characters, but some other libraries (like the one in php IIRC), that do this. So the idea was to be able to accept it.)
Ok cool! If you could fix up the two remaining comments then I'll happily merge this! Thanks for contributing 😄
using the utf-16 surrogate pairs