Fix: Preserve original encoding in claude-mcp-toggle

The save_config function was using json.dump with default ensure_ascii=True,
which converted all Romanian characters to \uXXXX escape sequences, making
the entire ~/.claude.json file appear modified even when only changing MCP
server configuration for a specific project.

Added ensure_ascii=False to preserve original UTF-8 encoding and minimize
file changes to only the intended MCP server modifications.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Marius
2025-10-08 15:27:16 +03:00
parent dfc64ec632
commit a68f6c381f

View File

@@ -21,7 +21,7 @@ def load_config():
def save_config(data): def save_config(data):
with open(CLAUDE_CONFIG, 'w') as f: with open(CLAUDE_CONFIG, 'w') as f:
json.dump(data, f, indent=2) json.dump(data, f, indent=2, ensure_ascii=False)
def list_servers(project_path=None): def list_servers(project_path=None):
data = load_config() data = load_config()