Skip to content

Commit ddb9cde

Browse files
committed
properly put escapes on strings
1 parent b47bfe3 commit ddb9cde

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

core/src/processing/data/IntDict.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -666,7 +666,7 @@ public void write(PrintWriter writer) {
666666
public String toJSON() {
667667
StringList items = new StringList();
668668
for (int i = 0; i < size(); i++) {
669-
items.append("\"" + keys[i] + "\": " + values[i]);
669+
items.append("\"" + JSONObject.quote(keys[i]) + "\": " + values[i]);
670670
}
671671
return "{ " + items.join(", ") + " }";
672672
}

core/todo.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ X some Table cleanup based on other CSV parsing work
33
X use StandardCharsets.UTF_8 instead of getting encoding by name
44
X PApplet.main(Blah.class) now works
55
X add toJSON() method to IntDict
6+
X had to use JSONObject.quote() to wrap the text
67
_ do the same for the other data classes
78
_ note the difference between this and toJSONObject() or toJSONArray()
89
_ or is that the better way to handle it? hm

0 commit comments

Comments
 (0)