[EMAIL PROTECTED] wrote: > i tried a couple python json libraries. i used simplejson on the > server and was using cjson on the client, but i ran into this issue. > i'm now using simplejson on both sides, but i'm still interested in > this issue. did i do something wrong? is there a bug in one of the > libraries? or something i don't understand about the json spec? > > > i problem is the line where i call cjson.decode() below: > >>>> import simplejson >>>> import cjson >>>> >>>> sj = simplejson.dumps('http://server.com') >>>> sj > '"http:\\/\\/server.com"' >>>> cj = cjson.encode('http://server.com') >>>> cj > '"http://server.com"' >>>> simplejson.loads(cj) > u'http://server.com' >>>> cjson.decode(cj) > 'http://server.com' >>>> simplejson.loads(sj) > u'http://server.com' >>>> cjson.decode(sj) > 'http:\\/\\/server.com' # is this correct????
Known issue. See: http://blog.extracheese.org/2007/07/when-json-isnt-json.html Neither project has fixed it it seems. Not sure which is actually the "correct" way to do it, but it would be nice if they would agree. j -- http://mail.python.org/mailman/listinfo/python-list