From 9617be0ca486db0c8ee5fa6c5d2bd39075d5d2b4 Mon Sep 17 00:00:00 2001 From: Rock Chin <1010553892@qq.com> Date: Sun, 2 Apr 2023 16:30:42 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=9C=AA=E6=8C=87=E5=AE=9Autf-8?= =?UTF-8?q?=E4=BF=9D=E5=AD=98=E5=B7=B2=E8=BE=93=E5=87=BA=E7=9A=84=E5=85=AC?= =?UTF-8?q?=E5=91=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkg/utils/announcement.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/utils/announcement.py b/pkg/utils/announcement.py index bec74bad..c348d36a 100644 --- a/pkg/utils/announcement.py +++ b/pkg/utils/announcement.py @@ -22,10 +22,10 @@ def read_saved() -> str: # 已保存的在res/announcement_saved # 检查是否存在 if not os.path.exists("res/announcement_saved"): - with open("res/announcement_saved", "w") as f: + with open("res/announcement_saved", "w", encoding="utf-8") as f: f.write("") - with open("res/announcement_saved", "r") as f: + with open("res/announcement_saved", "r", encoding="utf-8") as f: content = f.read() return content @@ -33,7 +33,7 @@ def read_saved() -> str: def write_saved(content: str): # 已保存的在res/announcement_saved - with open("res/announcement_saved", "w") as f: + with open("res/announcement_saved", "w", encoding="utf-8") as f: f.write(content)