Skip to content

fix(encoding): add UTF-8 encoding for Windows compatibility (#7537, #8901, #7058) - #13593

Closed
zhanggttry wants to merge 3 commits into
NousResearch:mainfrom
zhanggttry:fix/windows-encoding-issues
Closed

zhanggttry wants to merge 3 commits into
NousResearch:mainfrom
zhanggttry:fix/windows-encoding-issues

Conversation

@zhanggttry

Copy link
Copy Markdown
Contributor

Problem

Windows users encounter encoding errors when Hermes tries to:

  1. Print emoji characters (GBK codec can't encode 🩺) — Bug: Windows GBK encoding causes UnicodeEncodeError in doctor command #7537
  2. Read subprocess output without explicit encoding — OpenClaw migration crashes with UnicodeDecodeError on Windows (non-UTF-8 locale) #8901
  3. Open config files without UTF-8 encoding — [Bug]: Failed to load config.yml in Windows #7058

Solution

  • doctor.py: Replace 🩺 emoji with ASCII [Hermes Doctor] to avoid GBK encoding errors on Windows
  • claw.py: Add encoding="utf-8" and errors="replace" to all subprocess.run() calls for Windows compatibility
  • cli.py: Add encoding="utf-8" to config file open() call

Changes

File Change
hermes_cli/doctor.py Replace emoji header with ASCII
hermes_cli/claw.py Add encoding parameters to 4 subprocess calls
cli.py Add encoding to config file open()

Testing

  • Windows: hermes doctor should not crash with UnicodeEncodeError
  • Windows: hermes claw migrate subprocess calls should handle non-UTF8 output
  • All platforms: Config operations should work with UTF-8 encoded files

Related Issues

…arch#7537, NousResearch#8901, NousResearch#7058)

- doctor.py: replace emoji with ASCII to avoid GBK encoding errors
- claw.py: add encoding='utf-8' and errors='replace' to subprocess calls
- cli.py: add encoding='utf-8' to config file open()
@alt-glitch alt-glitch added type/bug Something isn't working comp/cli CLI entry point, hermes_cli/, setup wizard labels Apr 21, 2026
@alt-glitch

Copy link
Copy Markdown
Contributor

Related to #11731 (closed, GBK doctor fix) and #13241 (closed, Windows UTF-8) — covers same problem space but broader scope across 3 files.

@zhanggttry

Copy link
Copy Markdown
Contributor Author

Closing in favor of #13986 which already includes UTF-8 encoding fixes across all files. This PR also contained unrelated changes (concurrent.futures, account_usage, base_url_host_matches) that triggered Supply Chain Audit failures.

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

Labels

comp/cli CLI entry point, hermes_cli/, setup wizard type/bug Something isn't working

Projects

None yet

2 participants