Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #1219 from jacob-carlborg/issue_9794

Fixes Issue 9794 - std.json cannot handle delete character
  • Loading branch information...
commit 3724fe54411555d9256afed053aa65c0b7bf8514 2 parents 90b2e94 + a272a59
@braddr braddr authored
Showing with 9 additions and 1 deletion.
  1. +9 −1 std/json.d
View
10 std/json.d
@@ -20,6 +20,7 @@ module std.json;
import std.ascii;
import std.conv;
import std.range;
+import std.uni : isControl;
import std.utf;
private {
@@ -456,7 +457,12 @@ class JSONException : Exception {
}
}
-version(unittest) import std.stdio;
+version(unittest)
+{
+ import std.exception;
+ import std.stdio;
+}
+
unittest {
// An overly simple test suite, if it can parse a serializated string and
@@ -504,4 +510,6 @@ unittest {
assert(toJSON(&val) == "\"\Α\Β\Γ\"");
val = parseJSON(`"\u2660\u2666"`);
assert(toJSON(&val) == "\"\♠\♦\"");
+
+ assertNotThrown(parseJSON(`{ "foo": "` ~ "\u007F" ~ `"}`));
}
Please sign in to comment.
Something went wrong with that request. Please try again.