data.json

Error writing strings with characters outside the BMP

Details

  • Type: Defect Defect
  • Status: Closed Closed
  • Priority: Major 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.

  1. djson-3-non-bmp-chars-patch.txt
    20/Feb/12 4:03 PM
    2 kB
    Andy Fingerhut
  2. fix_unicode_non_bmp_2.patch
    13/Jan/12 1:29 AM
    0.5 kB
    Andy Fingerhut
  3. fix_unicode_non_bmp_3.patch
    13/Jan/12 3:18 PM
    1 kB
    Andy Fingerhut
  4. fix_unicode_non_bmp.patch
    05/Jan/12 5:57 PM
    4 kB
    Matthew Phillips

Activity

Matthew Phillips made changes -
Field Original Value New Value
Attachment fix_unicode_non_bmp.patch [ 10759 ]
Andy Fingerhut made changes -
Attachment fix_unicode_non_bmp_2.patch [ 10771 ]
Andy Fingerhut made changes -
Attachment fix_unicode_non_bmp_3.patch [ 10775 ]
Andy Fingerhut made changes -
Patch Code and Test [ 10002 ]
Andy Fingerhut made changes -
Attachment djson-3-non-bmp-chars-patch.txt [ 10934 ]
Stuart Sierra made changes -
Assignee Stuart Sierra [ stuart.sierra ]
Stuart Sierra made changes -
Resolution Completed [ 1 ]
Status Open [ 1 ] Resolved [ 5 ]
Stuart Sierra made changes -
Status Resolved [ 5 ] Closed [ 6 ]

People

Vote (1)
Watch (2)

Dates

  • Created:
    Updated:
    Resolved: