Skip to content

Comments

Fix Windows UTF-8 encoding issues in MCP STDIO communication#75

Open
matyasLevinsky wants to merge 1 commit intoMarkusPfundstein:mainfrom
matyasLevinsky:encoding-fix-only
Open

Fix Windows UTF-8 encoding issues in MCP STDIO communication#75
matyasLevinsky wants to merge 1 commit intoMarkusPfundstein:mainfrom
matyasLevinsky:encoding-fix-only

Conversation

@matyasLevinsky
Copy link

Resolves Unicode character corruption (e.g., řemeslník → Ĺ™emeslnĂ­k) when writing content through MCP on Windows systems.

Changes:

  • Add Windows-specific UTF-8 encoding configuration for stdin/stdout/stderr
  • Only applies on Windows when PYTHONIOENCODING is not already set
  • Process-local changes only, no system-wide impact

Based on official MCP SQLite server fix (modelcontextprotocol/servers#378)

Resolves Unicode character corruption (e.g., řemeslník → Ĺ™emeslnĂ­k)
when writing content through MCP on Windows systems.

Changes:
- Add Windows-specific UTF-8 encoding configuration for stdin/stdout/stderr
- Only applies on Windows when PYTHONIOENCODING is not already set
- Process-local changes only, no system-wide impact

Based on official MCP SQLite server fix (modelcontextprotocol/servers#378)
Addresses known Windows MCP encoding issues documented in GitHub issues
@nsvrana
Copy link

nsvrana commented Oct 20, 2025

Can confirm this resolved windows issues for me.

ernestkoe added a commit to ernestkoe/mcp-obsidian-ek that referenced this pull request Dec 29, 2025
- Add Windows UTF-8 STDIO encoding fix (PR MarkusPfundstein#75)
- Add ensure_ascii=False to json.dumps for proper Unicode (PR MarkusPfundstein#74)
- Add Dataview query tool for arbitrary DQL queries (PR MarkusPfundstein#53)

Skipped (already fixed by PR MarkusPfundstein#77):
- PR MarkusPfundstein#87: dirpath trailing slashes
- PR MarkusPfundstein#67: list_files_in_dir slash

Skipped (not needed):
- PR MarkusPfundstein#89: env var defaults (our approach works)
- PR MarkusPfundstein#69: too large, needs review

70 tests passing, 26 tools total.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@ernestkoe
Copy link

Applied to my maintained fork at https://github.com/ernestkoe/mcp-obsidian

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants