fix: Handle UTF-8 BOM in config.json
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 <noreply@anthropic.com>
This commit is contained in:
@@ -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 {}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user