Details
-
Type:
Defect
-
Status:
Resolved
-
Priority:
Major
-
Resolution: Completed
-
Affects Version/s: None
-
Fix Version/s: None
-
Component/s: None
-
Labels:None
-
Environment:Clojure 1.2 and 1.3, Mac OS X, Java 1.6
-
Patch:Code and Test
Description
[This ticket filed as a follow on from pull request 2 at github]
One of my users decided to start sending Emoji happy faces over a network protocol encoded using data.json, which caused it to promptly roll over and die. It turned out that write-json-string, while aware of the code point vs. character issue, was still iterating over a character count not a code point count.
I have demonstrated the problem in a test, and fixed this: will file a patch when my contributor agreement is in place.
Oh I see - I misunderstood what your were doing there, thinking it only applied to the escape-unicode == true case.
And of course the Clojure string is already in UTF-16, so there's no reason to turn it into 32 bit code points and then expand it back to UTF-16 pairs.