mirror of
https://github.com/processing/processing4.git
synced 2026-06-16 04:26:26 +02:00
properly put escapes on strings
This commit is contained in:
@@ -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(", ") + " }";
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ X some Table cleanup based on other CSV parsing work
|
||||
X use StandardCharsets.UTF_8 instead of getting encoding by name
|
||||
X PApplet.main(Blah.class) now works
|
||||
X add toJSON() method to IntDict
|
||||
X had to use JSONObject.quote() to wrap the text
|
||||
_ do the same for the other data classes
|
||||
_ note the difference between this and toJSONObject() or toJSONArray()
|
||||
_ or is that the better way to handle it? hm
|
||||
|
||||
Reference in New Issue
Block a user