configファイルを明示的にUTF-8で読み書きするように

This commit is contained in:
suti7yk5032 2024-08-15 22:46:55 +09:00
parent f7ecdc535f
commit 7a1aa6a7db

View file

@ -52,12 +52,12 @@ class DL():
}
}
with open(self.server_config_path, "w") as w:
json.dump(self.server_config, w, indent=4)
with open(self.server_config_path, "w", encoding="utf-8") as w:
json.dump(self.server_config, w, indent=4, ensure_ascii=False)
elif os.path.isfile(self.server_config_path):
with open(self.server_config_path, "r") as r:
with open(self.server_config_path, "r", encoding="utf-8") as r:
self.server_config = json.load(r)
print("config ファイルを読み込みました。")