diff options
author | Johannes Rudolph <johannes.rudolph@gmail.com> | 2014-03-11 16:44:55 +0100 |
---|---|---|
committer | Johannes Rudolph <johannes.rudolph@gmail.com> | 2014-03-11 16:44:55 +0100 |
commit | b477b82f98ce656b967be0916124cdcf1dab8126 (patch) | |
tree | 7a9b86582f9d3b348ef52f8e3f6832df174f2458 | |
parent | d1a9f98e4247ed7c3a72421dac3047255b6ffd8e (diff) | |
parent | ac55063146d3af509a66e0bee7f1062b54091188 (diff) | |
download | spray-json-b477b82f98ce656b967be0916124cdcf1dab8126.tar.gz spray-json-b477b82f98ce656b967be0916124cdcf1dab8126.tar.bz2 spray-json-b477b82f98ce656b967be0916124cdcf1dab8126.zip |
Merge pull request #91 from fractaloop/issue-90-escape-control-characters
Fix for Issue #90
-rw-r--r-- | src/main/scala/spray/json/JsonPrinter.scala | 2 | ||||
-rw-r--r-- | src/test/scala/spray/json/CompactPrinterSpec.scala | 1 |
2 files changed, 2 insertions, 1 deletions
diff --git a/src/main/scala/spray/json/JsonPrinter.scala b/src/main/scala/spray/json/JsonPrinter.scala index e47989e..bc1e375 100644 --- a/src/main/scala/spray/json/JsonPrinter.scala +++ b/src/main/scala/spray/json/JsonPrinter.scala @@ -105,7 +105,7 @@ object JsonPrinter { } private[this] def mark(range: scala.collection.immutable.NumericRange[Char]): Unit = range foreach (mark) - mark('\u0000' to '\u0019') + mark('\u0000' to '\u001f') mark('\u007f') mark('"') mark('\\') diff --git a/src/test/scala/spray/json/CompactPrinterSpec.scala b/src/test/scala/spray/json/CompactPrinterSpec.scala index 5485d7d..79c0877 100644 --- a/src/test/scala/spray/json/CompactPrinterSpec.scala +++ b/src/test/scala/spray/json/CompactPrinterSpec.scala @@ -54,6 +54,7 @@ class CompactPrinterSpec extends Specification { CompactPrinter(JsString("\u0100")) mustEqual "\"\\u0100\"" CompactPrinter(JsString("\u0010")) mustEqual "\"\\u0010\"" CompactPrinter(JsString("\u0001")) mustEqual "\"\\u0001\"" + CompactPrinter(JsString("\u001e")) mustEqual "\"\\u001e\"" } "properly print a simple JsObject" in ( CompactPrinter(JsObject("key" -> JsNumber(42), "key2" -> JsString("value"))) |