>> import simplejson >>> si...">

Decode jon unicode in python simplejson

I cant decode json strings like this: "\ u0e4f \ u0361 \ u032f \ u0e4f"

>>> import simplejson
>>> simplejson.loads('"\u0e4f\u0361\u032f\u0e4f"', encoding='utf8')
u'\u0e4f\u0361\u032f\u0e4f'

      

However php json_decode works fine:

json_decode('"\u0e4f\u0361\u032f\u0e4f"');

      

What am I doing wrong?

+2


a source to share


1 answer


Nothing. The Python REPL prints line () lines, not a string.



>>> print u'\u0e4f\u0361\u032f\u0e4f'
เนอกฬฏเน

      

+2


a source







All Articles