views:

124

answers:

1

I can't 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?

+1  A: 

Nothing. The Python REPL prints the repr() of the string, not the string itself.

>>> print u'\u0e4f\u0361\u032f\u0e4f'
๏̯͡๏
Ignacio Vazquez-Abrams