python存储json时,发生中文乱码 指定编码格式encoding='utf-8' encoding='utf-8' ensure_ascii默认为True,表示会将所有输入的非ASCII字符转义。要改成False ensure_ascii=False with open(data_path, 'w',encoding='utf-8') as f: json.dump(content, f, indent=2,ensure_ascii=False) return content