views:

176

answers:

1

i have a dictionary when i pass it over simplejson.dumps(dict) the json output has put some sort of encoding on a string url?

"link": "http:\/\/www.mydomain.com"

How can i stop this?

Im using app engine simplejson.

+1  A: 

I don't see a problem with this. This encoding for the forward slash is perfectly valid. If the other side can't decode this then it's their JSON library that is broken.

Ignacio Vazquez-Abrams
Hmmm - Ok so what you are saying is this encoding is perfectly acceptable - so can i ask why the twitter api doesn't use these backslashes in their json output>
spidee
The JSON specification says you can escape a forward slash, but it doesn't actually say you must escape it. So either is correct (but a JSON decoder must accept both). See http://www.json.org/ A string can contain any unicode character unescaped except " \ or a control character (so that includes /), and \ may be followed by a variety of things including /
Duncan