mirror of
https://github.com/open-jarvis/OpenJarvis.git
synced 2026-07-28 14:07:55 +00:00
On Windows the default Python stdout encoding follows the system ANSI code page (cp950 for zh-TW, cp932 for ja, cp949 for ko). `click.echo()` then raises `UnicodeEncodeError` whenever a CJK character lands in CLI output — `jarvis ask` returning Chinese crashes with `'cp950' codec can't encode character '义'`. Reconfigure `sys.stdout` and `sys.stderr` to UTF-8 with `errors='replace'` at the `main()` entry point. Scoped to `win32` so other platforms are untouched. Two unit tests verify the reconfigure happens on Windows and doesn't on Linux. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>