Skip to content

v1.4.7 — Fix UnicodeEncodeError on Windows non-UTF8 code pages

Choose a tag to compare

@gokmengokhan gokmengokhan released this 25 May 07:54
· 5 commits to main since this release

Bug fix

Fixes UnicodeEncodeError: 'cp950' codec can't encode character '✓' (and similar errors on other locale-specific Windows code pages — cp932 for Japanese, cp949 for Korean, cp1252 for Western European) during endnote-mcp index and the MCP rebuild_index tool.

Root cause: the CLI output uses non-ASCII glyphs (, progress-bar blocks , dashes ). On Windows, Python's default stdio encoding is the locale code page, not UTF-8 — so printing from a Traditional Chinese (cp950) console crashed.

Fix:

  1. cli.py reconfigures sys.stdout and sys.stderr to UTF-8 with errors=\"replace\" at module load, protecting all direct CLI usage regardless of the system locale.
  2. server.py rebuild_index now passes PYTHONIOENCODING=utf-8 and PYTHONUTF8=1 to the spawned subprocess, and reads its output with encoding=\"utf-8\", errors=\"replace\".

Reported by: a user running endnote-mcp on Traditional Chinese Windows — thanks!

Install / upgrade

uv tool install --upgrade endnote-mcp
# or
pipx upgrade endnote-mcp