摘要: ``` import json d = {"name":"英雄无敌7"} res = json.dumps(d) # 打印res 会显示 {"name": "\u82f1\u96c4\u65e0\u654c7"}。原因是在默认情况下,调用json.dumps会对中文采用ASCII进行编码,故显示异常。 # 想要显示中文,需要更改默认的参数,如: res = json.dumps(d,ensur... 阅读全文
posted @ 2018-02-26 22:03 罗曼骑士 阅读(579) 评论(0) 推荐(0) 编辑