GNU bug report logs - #17133
json-encode-string incorrectly encodes extra-BMP characters

Previous Next

Package: emacs;

Reported by: Nathan Trapuzzano <nbtrap <at> nbtrap.com>

Date: Fri, 28 Mar 2014 22:24:01 UTC

Severity: normal

Done: Simen Heggestøyl <simenheg <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Nathan Trapuzzano <nbtrap <at> nbtrap.com>
To: 17133 <at> debbugs.gnu.org
Subject: bug#17133: json-encode-string incorrectly encodes extra-BMP characters
Date: Fri, 28 Mar 2014 18:22:25 -0400
M-: (princ (json-encode "\U0001d11e"))
==> "\u1d11e"  ;; should be "\ud834\udd1e" or "𝄞"

From ECMA-404:

  To escape a code point 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".




This bug report was last modified 9 years and 290 days ago.

Previous Next


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