Fix encoding of JSON surrogate pairs
authorPhilipp Stephani <phst@google.com>
Mon, 24 Oct 2016 19:54:51 +0000 (21:54 +0200)
committerPhilipp Stephani <phst@google.com>
Sun, 1 Jan 2017 12:24:14 +0000 (13:24 +0100)
commit93be35e038bbb19e8d64d3c1f9d1be76a9083d09
tree7a9074fa83d51aa8136f57be267c83016c4f3978
parentbaa370f255d2f9d3f662fac0de98eaadd3242aa6
Fix encoding of JSON surrogate pairs

JSON requires that such pairs be treated as UTF-16 surrogate pairs, not
individual code points; cf. Bug #24784.

* lisp/json.el (json-read-escaped-char): Fix decoding of surrogate
pairs.
(json--decode-utf-16-surrogates): New defun.

* test/lisp/json-tests.el (test-json-read-string): Add test for
surrogate pairs.
lisp/json.el
test/lisp/json-tests.el