python利用json中关于中文输出的问题,ensure_ascii=False

import json
print(json.dumps("机器猫"))

#这时候其实输出的并不是中文,而是ASCII中对应的机器猫的字符码
#原因:json.dumps序列化时候对中文默认使用的ascii编码,想要输出真正的中文需要指定ensure_ascii=False



import json
print(json.dumps("机器猫",ensure_ascii=False))