From 450dd34f4d271b95db9c7f685d861523bebcd33d Mon Sep 17 00:00:00 2001 From: Soulter <905617992@qq.com> Date: Sat, 25 Nov 2023 11:59:39 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20dump=20=E9=85=8D=E7=BD=AE=E6=97=B6?= =?UTF-8?q?=E5=85=B3=E9=97=AD=E5=BC=BA=E5=88=B6ascii?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- util/cmd_config.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/util/cmd_config.py b/util/cmd_config.py index 7ec087f6b..d5fc5cdcc 100644 --- a/util/cmd_config.py +++ b/util/cmd_config.py @@ -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() \ No newline at end of file