会员
周边
捐助
新闻
博问
闪存
赞助商
所有博客
当前博客
我的博客
我的园子
账号设置
简洁模式
...
退出登录
注册
登录
罗曼骑士
博客园
首页
新随笔
联系
订阅
管理
2018年2月26日
python json库序列化支持中文
摘要: ``` 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)
编辑
公告