Details
-
Bug
-
Resolution: Done
-
P2: Important
-
5.2.1
-
None
Description
The QML JSON parser rejects "\uXXXX" escape sequences where XXXX <= 001f. RFC 4627 states that any character may be escaped, including all characters in the Basic Multilingual Plane (U+0000 through U+FFFF).
JSON.stringify() can generate data that triggers this error, for example:
JSON.parse(JSON.stringify(["\u0007"]))
The function scanEscapeSequence() in qtdeclarative/src/qml/jsruntime/qjsonobject.cpp rejects these escape sequences. The base Qt JSON parser at qtbase/src/corelib/json/qjsonparser.cpp has a slightly different version of scanEscapeSequence() that does not reject these sequences, and additionally relaxes strictness by allowing invalid escape characters.
The base Qt JSON parser and the QML JSON parser should accept the same set of strings for consistency.