GNU bug report logs - #24784
26.0.50; JSON strings with utf-16 escape codes

Previous Next

Package: emacs;

Reported by: Helmut Eller <eller.helmut <at> gmail.com>

Date: Mon, 24 Oct 2016 18:07:01 UTC

Severity: normal

Found in version 26.0.50

Done: Philipp Stephani <p.stephani2 <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


Message #8 received at 24784 <at> debbugs.gnu.org (full text, mbox):

From: Philipp Stephani <p.stephani2 <at> gmail.com>
To: Helmut Eller <eller.helmut <at> gmail.com>, 24784 <at> debbugs.gnu.org
Subject: Re: bug#24784: 26.0.50; JSON strings with utf-16 escape codes
Date: Mon, 24 Oct 2016 19:57:19 +0000
[Message part 1 (text/plain, inline)]
Helmut Eller <eller.helmut <at> gmail.com> schrieb am Mo., 24. Okt. 2016 um
20:58 Uhr:

>
> json-read-from-string doesn't parse strings correctly if the the \u
> syntax is used to write UTF-16 surrogates:
>
>  (equal (json-read-from-string "\"\\uD834\\uDD1E\"") "\"\U0001D11E\"")
>  => nil
>
> The correct result t.  To quote RFC 7159[*]:
>
>    To escape an extended character that is not in the Basic Multilingual
>    Plane, the character is represented as a 12-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/html/rfc7159#section-7
>
> Thanks for reporting, I've attached a patch.
[Message part 2 (text/html, inline)]
[0001-Fix-encoding-of-JSON-surrogate-pairs.txt (text/plain, attachment)]

This bug report was last modified 8 years and 145 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.