Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix: \u0001 -> \u0001

  • Loading branch information...
commit 7e791d2efd6899d03bf8c200ce29b51112d5465b 1 parent b9c5163
@jdanbrown jdanbrown authored
View
1  src/main/scala/spray/json/JsonPrinter.scala
@@ -67,6 +67,7 @@ trait JsonPrinter extends (JsValue => String) {
case '\n' => sb.append("\\n")
case '\r' => sb.append("\\r")
case '\t' => sb.append("\\t")
+ case x if x <= 0xF => sb.append("\\u000").append(Integer.toHexString(x))
case x if x <= 0xFF => sb.append("\\u00").append(Integer.toHexString(x))
case x if x <= 0xFFF => sb.append("\\u0").append(Integer.toHexString(x))
case x => sb.append("\\u").append(Integer.toHexString(x))
View
2  src/test/scala/spray/json/CompactPrinterSpec.scala
@@ -53,7 +53,7 @@ class CompactPrinterSpec extends Specification {
CompactPrinter(JsString("\u1000")) mustEqual "\"\\u1000\""
CompactPrinter(JsString("\u0100")) mustEqual "\"\\u0100\""
CompactPrinter(JsString("\u0010")) mustEqual "\"\\u0010\""
- CompactPrinter(JsString("\u0001")) mustEqual "\"\\u0001\"" // FIXME
+ CompactPrinter(JsString("\u0001")) mustEqual "\"\\u0001\""
}
"properly print a simple JsObject" in (
CompactPrinter(JsObject("key" -> JsNumber(42), "key2" -> JsString("value")))
Please sign in to comment.
Something went wrong with that request. Please try again.