output encoding

The output will be ascii character codes in 'China', not real Chinese. This is because json.dumps uses ascii encoding for Chinese by default when serializing. To output real Chinese, you need to specify ensure_ascii=False:

>>> import json
>>> print json.dumps('China')
"\u4e2d\u56fd"
>>> print json.dumps('中国',ensure_ascii=False)
"China"

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324947521&siteId=291194637