I have a very simple json I can\'t parse with simplejson module. Reproduction:
import simplejson as json
json.loads(r\'{\"translatedatt1\":\"Vari\\351es\"}\'
You probably did not intend to use a raw string, but a unicode string?
>>> import simplejson as json
>>> json.loads(u'{"translatedatt1":"Vari\351es"}')
{u'translatedatt1': u'Vari\xe9es'}
If you want to quote the data inside the JSON string you need to use \uNNNN
:
>>> json.loads(r'{"translatedatt1":"Vari\u351es"}')
{'translatedatt1': u'Vari\u351es'}
Please note that the resulting dict is slightly different in this case. When parsing a unicode string simplejson uses unicode strings
for the keys. Otherwise it uses byte string
keys.
If your JSON data does in fact use \351e
than it is simply broken and no valid JSON.