mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-06-02 12:05:54 +00:00
fix: 未指定utf-8保存已输出的公告
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user