[Bug 29216] New: JSON Conversion: Handling of surrogate pairs

https://www.w3.org/Bugs/Public/show_bug.cgi?id=29216

            Bug ID: 29216
           Summary: JSON Conversion: Handling of surrogate pairs
           Product: XPath / XQuery / XSLT
           Version: Candidate Recommendation
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Functions and Operators 3.1
          Assignee: mike@saxonica.com
          Reporter: christian.gruen@gmail.com
        QA Contact: public-qt-comments@w3.org
  Target Milestone: ---

I believe that the parsing of surrogate pairs in the JSON conversion process
needs some clarification. In the current "escape" option rules for
fn:parse-json and fn:json-to-xml, it is only insinuated that surrogate pairs
need to be considered as well: "(for example, unpaired surrogates)", "This
includes codepoints representing unpaired surrogates".

But I am wondering what is going to happen if a high surrogate is found that is
not followed by a valid low surrogate. The following query...

  fn:parse-json('"\uD800\uD83C\uDC1C"', map { 'escape': true() })

might return one of the following results:

  a) \uD800, followed by the surrogate pair for U+1F01C, or
  b) \uD800\uD83C\uDC1C

Intuitively, I would expect a) to be correct: As \uD83C is no valid low
surrogate, it is not combined with the high surrogate. b) would be correct if
\uD83C was interpreted as low surrogate. As a result, \uDC1C is then invalid as
well.

Any thoughts? Maybe the parsing of surrogate pairs is already standardized
somewhere else (I couldn't find anything so far)?

-- 
You are receiving this mail because:
You are the QA Contact for the bug.

Received on Wednesday, 21 October 2015 09:47:49 UTC