python \uxxxx转中文,Python列表中的字典 \uxxxx转中文,
import json a = [{u'mobile': u'8973', u'userName': u'\u738b\u738d', u'idCard': u'110222196308253111', u'roleFlag': 7}] print json.dumps(a).decode("unicode_escape")
输出结果是:
[{"mobile": "8973", "userName": "王玍", "idCard": "110222196308253111", "roleFlag": 7}]
例子二:
aa = u'\u738b\u738d' print json.dumps(aa).decode("unicode_escape")
输出结果:
"王玍"
如果觉得对您有帮助,麻烦您点一下推荐,谢谢!
好记忆不如烂笔头
好记忆不如烂笔头