chore: 避免 json 配置中文乱码

This commit is contained in:
amtoaer
2023-11-25 13:30:09 +08:00
parent 30fcda995e
commit c5fc924b0a

View File

@@ -40,7 +40,9 @@ class Config(DataClassJsonMixin):
try:
path.parent.mkdir(parents=True, exist_ok=True)
with path.open("w") as f:
f.write(Config.schema().dumps(self, indent=4))
f.write(
Config.schema().dumps(self, indent=4, ensure_ascii=False)
)
return self
except Exception as e:
raise RuntimeError(f"Failed to save config file: {path}") from e