obj = dict(name='小明', age=20) s = json.dumps(obj,ensure_ascii=False)
把ensure_ascii设置为false就能正确输出中文,这里ensuer_ascii是确保传输编码是ASCII格式吧.
Sign in to make a reply
叫是先生
obj = dict(name='小明', age=20) s = json.dumps(obj,ensure_ascii=False)
把ensure_ascii设置为false就能正确输出中文,这里ensuer_ascii是确保传输编码是ASCII格式吧.