mirror of
https://github.com/amtoaer/bili-sync.git
synced 2026-09-06 16:07:26 +08:00
chore: 避免 json 配置中文乱码
This commit is contained in:
+3
-1
@@ -40,7 +40,9 @@ class Config(DataClassJsonMixin):
|
|||||||
try:
|
try:
|
||||||
path.parent.mkdir(parents=True, exist_ok=True)
|
path.parent.mkdir(parents=True, exist_ok=True)
|
||||||
with path.open("w") as f:
|
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
|
return self
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
raise RuntimeError(f"Failed to save config file: {path}") from e
|
raise RuntimeError(f"Failed to save config file: {path}") from e
|
||||||
|
|||||||
Reference in New Issue
Block a user