From eb3043ab6d42216ae4833589d8ca7effba2f0ece Mon Sep 17 00:00:00 2001 From: Jakub Andrysek Date: Fri, 27 Sep 2024 13:34:17 +0200 Subject: [PATCH] Refactor file encoding in socketio_events.py --- ForrestHub-app/app/socketio_events.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ForrestHub-app/app/socketio_events.py b/ForrestHub-app/app/socketio_events.py index 3d4880a..e97317c 100644 --- a/ForrestHub-app/app/socketio_events.py +++ b/ForrestHub-app/app/socketio_events.py @@ -160,7 +160,7 @@ def handle_get_page_html(json: dict) -> dict: if not page_path.exists(): return {"status": "error", "message": "Tuhle stránku hry nemám k editaci"} - with open(page_path, "r") as f: + with open(page_path, "r", encoding="utf-8") as f: content = f.read() return {"status": "ok", "content": content} @@ -188,6 +188,6 @@ def handle_set_page_html(json: dict) -> dict: if not page_path.exists(): return {"status": "error", "message": "Page does not exist"} - with open(page_path, "w") as f: + with open(page_path, "w", encoding="utf-8") as f: f.write(page_content) return {"status": "ok"} \ No newline at end of file