www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 17555] New: [REG2.070.0] Control characters in JSON data are


          Issue ID: 17555
           Summary: [REG2.070.0] Control characters in JSON data are
                    invalid and should cause an exception
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: regression
          Priority: P1
         Component: phobos
          Assignee: nobody puremagic.com
          Reporter: dlang-bugzilla thecybershadow.net

As per the JSON spec, raw control characters are not allowed in Unicode data. D
correctly threw upon encountering them before 2.070.0.

Test case:

//////////////// test.d ////////////////
import std.exception;
import std.json;

void main()

After 2.070, parseJSON returns nonsense data: 




(i.e. the characters are "escaped" despite being decoded, not encoded).

Introduced in https://github.com/dlang/phobos/pull/3872

Jun 26 2017