Repository navigation
v0.2.7: Fix garbled non-ASCII output on Windows
What's Changed
Bug Fix
- Fix garbled non-ASCII (Chinese, etc.) output on Windows — Reconfigure stdout/stderr to UTF-8 at CLI startup. Windows console defaults to the system code page (e.g. CP936 for Chinese locales), which caused garbled output when printing Unicode characters via
json.dumps(ensure_ascii=False).
Details
- Added
_ensure_utf8_stdio()incli.pythat callssys.stdout.reconfigure(encoding='utf-8')on Windows - Safe: only activates on
sys.platform == 'win32', no-op on macOS/Linux - Requires Python 3.7+ (project requires 3.11+)
Full Changelog: v0.2.6...v0.2.7