W3C home > Mailing lists > Public > public-qt-comments@w3.org > October 2015

[Bug 29216] JSON Conversion: Handling of surrogate pairs

From: <bugzilla@jessica.w3.org>
Date: Wed, 21 Oct 2015 22:25:46 +0000
To: public-qt-comments@w3.org
Message-ID: <bug-29216-523-guwigR9P2t@http.www.w3.org/Bugs/Public/>
https://www.w3.org/Bugs/Public/show_bug.cgi?id=29216

--- Comment #1 from Michael Kay <mike@saxonica.com> ---
RFC 7159 section 8.2 says, pragmatically:

   However, the ABNF in this specification allows member names and
   string values to contain bit sequences that cannot encode Unicode
   characters; for example, "\uDEAD" (a single unpaired UTF-16
   surrogate).  Instances of this have been observed, for example, when
   a library truncates a UTF-16 string without checking whether the
   truncation split a surrogate pair.  The behavior of software that
   receives JSON texts containing such values is unpredictable; for
   example, implementations might return different values for the length
   of a string value or even suffer fatal runtime exceptions.

Since the JSON RFC says the effects of doing this kind of thing are
unpredictable, I really don't think it's necessary that we pin it down any
further than we do at the moment.

I would also tend to expect your option (a), but I really don't think it
matters greatly if the software does something else. Anyone who puts unpaired
surrogates in their data deserves what they get.

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
Received on Wednesday, 21 October 2015 22:25:49 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 21 October 2015 22:25:49 UTC