On 26 December 2012 12:39, Saju M <sajup...@gmail.com> wrote: > Hi, > > I am facing an issue while decoding json string using json.loads(jstring). > Its working, if i do json.dumps(eval(jstring)) before json.loads(jstring). > I could not figure out the issue. I want to avoide use of "eval" here. > > > > *######################## Failing without json.dumps(eval(jstring)) > ########################* > > > def format_json_string(self, jstring): > """ > """ > from pprint import pprint > print "===string before urllib.unquote===", pprint(jstring) > jstring = urllib.unquote(jstring)##For revert encode change applied in > the javascript [...]
urllib.unquote is messing up the JSON. Reverse the order of unquote, and loads, i.e., do a json.loads on the original string, and then urllib.unquote the components that need unquoting. Regards, Gora _______________________________________________ BangPypers mailing list BangPypers@python.org http://mail.python.org/mailman/listinfo/bangpypers