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


Message #10 received at 17133-done <at> debbugs.gnu.org (full text, mbox):

From: Simen Heggestøyl <simenheg <at> gmail.com>
To: Nathan Trapuzzano <nbtrap <at> nbtrap.com>
Cc: 17133-done <at> debbugs.gnu.org, dgutov <at> yandex.ru
Subject: Re: bug#17133: json-encode-string incorrectly encodes extra-BMP
 characters
Date: Sun, 04 Oct 2015 17:55:22 +0200
Nathan Trapuzzano <nbtrap <at> nbtrap.com> writes:
> 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 seems to be working as expected in master now; (json-encode
"\U0001d11e") produces "𝄞" as described.

-- Simen




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

Previous Next


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