Skip to content

v0.2.7: Fix garbled non-ASCII output on Windows

Choose a tag to compare

@mikuh mikuh released this 13 Feb 08:07
· 7 commits to main since this release

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() in cli.py that calls sys.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