From 2f80a4ac76780340e00e494f4963a9a64e33e796 Mon Sep 17 00:00:00 2001 From: egg Date: Wed, 17 Dec 2025 11:14:54 +0800 Subject: [PATCH] fix: Handle UTF-8 BOM in config.json MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Use utf-8-sig encoding to handle Windows BOM (Byte Order Mark) that may be present in config.json files edited with Notepad. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- backend/run_server.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/backend/run_server.py b/backend/run_server.py index f10830c..9a85565 100644 --- a/backend/run_server.py +++ b/backend/run_server.py @@ -26,7 +26,8 @@ def load_config(config_path: str | None = None) -> dict: config_path = os.path.join(base_dir, "config.json") if os.path.exists(config_path): - with open(config_path, "r", encoding="utf-8") as f: + # Use utf-8-sig to handle Windows BOM (Byte Order Mark) + with open(config_path, "r", encoding="utf-8-sig") as f: return json.load(f) return {}