Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
0.9
-
None
-
None
-
couchdb 0.9.0 spidermonkey 0.7.0 erlang R12B3
Description
Handling of some unicode values escaped in json format \uXXXX fails with "invalid_json" error.
curl -X PUT -d '
{"revisions":[],"_id":"U_1d11e","codepoint":"3441","definition":"\uD834\uDD1E G clef character"}' http://localhost:5984/mydb/U_1d11e
yields
{"error":"invalid_json","reason":"
{\"revisions\":[],\"_id\":\"U_1d11e\",\"codepoint\":\"3441\",\"definition\":\"\\uD834\\uDD1E G clef character\"}"}
When the RFC states:
To escape an extended character 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".
Furthermore, couchdb accepts encoded strings of the format \uXXXXXXXX which is not mentioned as acceptable in the json rfc
curl -X PUT -d '
{"revisions":[],"_id":"U_1d11e","codepoint":"3441","definition":"\u0001D11E G clef character"}' http://localhost:5984/mydb/U_1d11e
Yields:
Attachments
Attachments
Issue Links
- is related to
-
COUCHDB-327 Replication of document results in invalid_json error
- Closed