java - JSONObject.toString: how NOT to escape slashes -
i need send date in json. date string should this:
"2013/5/15"
instead , jsonobject.tostring escapes follows:
"2013\ /5\ /15"
i understand done allow json strings inside scripts tags, question explains: json: why forward slashes escaped?
but in case don't need it. in fact server returning error. server not dealing , can't fix server, must fix in mobile client code.
i string.replace after serializing it, if wanted include "\ /" string in other part of json?
is there way serialize json object without escaping slashes? (if possible, without escaping anything)
thanks in advance.
i opted quick , dirty trick of replacing escaped slashes in serialized string before sending server. luckily, jsonobject escapes backslashes, must unscape them. if wanted send "\ /" intentionally escaped string "\\/" , result of replacing original string intended.
Comments
Post a Comment