shared: json - support escaping utf16 surrogate pairs

System Internals / systemd - Tom Gundersen [jklm.no] - 22 December 2014 13:27 UTC

We originally only supported escaping ucs2 encoded characters (as \uxxxx). This only covers the BMP. Support escaping also utf16 surrogate pairs (on the form \uxxxx\uyyyy) to cover all of unicode.

9bae67d shared: json - support escaping utf16 surrogate pairs
src/shared/json.c | 81 ++++++++++++++++++++++++++++++++++++--------------
src/test/test-json.c | 3 ++
2 files changed, 62 insertions(+), 22 deletions(-)

Upstream: github.com


  • Share