Can std.json handle Unicode?

Sean Kelly sean at invisibleduck.org
Mon Mar 25 15:48:29 PDT 2013


On Mar 23, 2013, at 5:22 AM, Jacob Carlborg <doob at me.com> wrote:

> I'm wondering because I see that std.json uses isControl, isDigit and isHexDigit from std.ascii and not std.uni. This also causes a problem with a pull request I recently made for std.net.isemail. In one of its unit tests the DEL character (127) is used. According to std.ascii.isControl this is a control character, but not according to std.uni.isControl. This will cause the test suite for the pull request not to be run since std.json chokes on the DEL character.

I don't know about control characters, but std.json doesn't handle UTF-16 surrogate pairs in strings, which are legal JSON.  I *think* it does properly handle the 32 bit code points though.


More information about the Digitalmars-d-learn mailing list