#8474 closed defect (fixed)
Properly escape GeoJSON
Reported by: | oschrenk | Owned by: | team |
---|---|---|---|
Priority: | normal | Milestone: | 13.12 |
Component: | Core | Version: | |
Keywords: | Cc: |
Description (last modified by )
Right now GeoJSON isn't properly escaped.
- It does escape double quote with two slashes. This only makes sense if the GeoJSON code is inlined in JavaScript, as two escaping mechanisms are needed.
- It does not escape all characters required by RFC 4627
I suggest using either json-simple's JSONValue#escape method [1] (Apache license) or to adapt gson's sring method [2] (Apache license)
[1] https://code.google.com/p/json-simple/source/browse/trunk/src/main/java/org/json/simple/JSONValue.java
[2] https://code.google.com/searchframe#1W0hTXRl0vg/trunk/gson/src/main/java/com/google/gson/stream/JsonWriter.java&l=532
I was using JOSM to export a GeoJSON layer for Polymaps which choked on double quotes being escaped with two slashes.
Attachments (0)
Change History (4)
comment:1 by , 12 years ago
Description: | modified (diff) |
---|
comment:3 by , 11 years ago
Milestone: | → 13.12 (6502) |
---|
escaped numbering.