JSON serializer adds unnecessary backslashes
or-else opened this issue · comments
Gene commented
The currently used JSON serializer adds backslashes for forward slashes, i.e. string "abc/def"
becomes "abc\/def"
.
aforge commented
This seems to have been a long-standing issue:
https://stackoverflow.com/questions/47076329/swift-string-escaping-when-serializing-to-json-using-codable
We'll perhaps have to use string replacement as a workaround for now.
Gene commented
I just checked: js and go parse such strings correctly:
var z = '{"x": "http:\/\/www.example.com\/"}';
console.log(JSON.parse(z));
Result:
{x: "http://www.example.com/"}
Go:
https://play.golang.org/p/0quh2bzP4hL
I'll check in Java and if it parses it correctly too then it's not a problem at all.
Gene commented
I just checked it on Android. It handles such json without any problems. We don't need to do anything. Closing.