properly put escapes on strings

This commit is contained in:
Ben Fry
2016-08-09 18:35:21 -04:00
parent c3bd8506b7
commit 6cf8e399fe
2 changed files with 2 additions and 1 deletions

View File

@@ -666,7 +666,7 @@ public class IntDict {
public String toJSON() {
StringList items = new StringList();
for (int i = 0; i < size(); i++) {
items.append("\"" + keys[i] + "\": " + values[i]);
items.append("\"" + JSONObject.quote(keys[i]) + "\": " + values[i]);
}
return "{ " + items.join(", ") + " }";
}