Fix: ensure encoding=utf-8 for json

This commit is contained in:
litagin02
2024-01-01 09:26:36 +09:00
parent e9db74ac6d
commit f2e7c18aa9
5 changed files with 22 additions and 14 deletions

View File

@@ -11,7 +11,7 @@ def set_style_config(json_path, output_path):
json_dict = json.load(f)
json_dict["data"]["num_styles"] = 1
json_dict["data"]["style2id"] = {DEFAULT_STYLE: 0}
with open(output_path, "w") as f:
with open(output_path, "w", encoding="utf-8") as f:
json.dump(json_dict, f, indent=2)
logger.info(f"Save style config (only {DEFAULT_STYLE}) to {output_path}")