json序列化时,默认遇到中文会转换成unicode,如果想要保留中文怎么办?

import json

a = json.dumps({"ddf": "你好"}, ensure_ascii=False)
print(a)
# {"ddf": "你好"}
Python

发表评论

后才能评论