看来您的输入使用反斜杠作为转义字符,您应该先取消转义文本,然后再将其传递给
json:
>>> foobar = '{\"body\": \"\\u05e9\"}'>>> import re>>> json_text = re.sub(r'\(.)', r'1', foobar) # unescape>>> import json>>> print(json.loads(json_text)['body'])ש不要
'unipre-escape'在JSON文本上使用编码;它可能会产生不同的结果:
>>> import json>>> json_text = '["\ud83d\ude02"]'>>> json.loads(json_text)['



