perf: dump 配置时关闭强制ascii

This commit is contained in:
Soulter
2023-11-25 11:59:39 +08:00
parent 89ed31a888
commit 450dd34f4d
+3 -3
View File
@@ -6,7 +6,7 @@ cpath = "cmd_config.json"
def check_exist():
if not os.path.exists(cpath):
with open(cpath, "w", encoding="utf-8") as f:
json.dump({}, f, indent=4)
json.dump({}, f, indent=4, ensure_ascii=False)
f.flush()
class CmdConfig():
@@ -34,7 +34,7 @@ class CmdConfig():
d = json.load(f)
d[key] = value
with open(cpath, "w", encoding="utf-8") as f:
json.dump(d, f, indent=4)
json.dump(d, f, indent=4, ensure_ascii=False)
f.flush()
@staticmethod
@@ -49,5 +49,5 @@ class CmdConfig():
_tag = True
if _tag:
with open(cpath, "w", encoding="utf-8") as f:
json.dump(d, f, indent=4)
json.dump(d, f, indent=4, ensure_ascii=False)
f.flush()