--- a/src/Pure/General/json.scala Tue Jan 03 14:45:50 2017 +0100
+++ b/src/Pure/General/json.scala Tue Jan 03 15:07:50 2017 +0100
@@ -32,7 +32,19 @@
def string(s: String)
{
result += '"'
- result ++= scala.util.parsing.json.JSONFormat.quoteString(s)
+ result ++=
+ s.iterator.map {
+ case '"' => "\\\""
+ case '\\' => "\\\\"
+ case '\b' => "\\b"
+ case '\f' => "\\f"
+ case '\n' => "\\n"
+ case '\r' => "\\r"
+ case '\t' => "\\t"
+ case c =>
+ if (c <= '\u001f' || c >= '\u007f' && c <= '\u009f') "\\u%04x".format(c.toInt)
+ else c
+ }.mkString
result += '"'
}