Skip to content

fix: read PowerShell output as UTF-8 - #155

Merged
TMHSDigital merged 1 commit into
mainfrom
fix/powershell-utf8
Oct 25, 2026
Merged

TMHSDigital merged 1 commit into
mainfrom
fix/powershell-utf8

Conversation

@TMHSDigital

Copy link
Copy Markdown
Owner

PowerShell wrote its console OEM code page (437), so:

  • a window title with `é` came back with U+FFFD and `window:<title>` stopped matching
  • `find_text` failed with `Bad control character in string literal` when the screen showed `•` or `→` (mapped to 0x07 / 0x1A)

`runPowerShell` now prepends `[Console]::OutputEncoding = [System.Text.Encoding]::UTF8`. Found while running the #129 cookbook recipes end to end.

Tests: unit check that the preamble is sent; live harness opens a window titled `SC-TÉST — ünï 日本` with `Café • next → done` on it, matches it exactly and OCRs it. Bumps to 0.27.1.

🤖 Generated with Claude Code

Window titles with non-ASCII characters stopped matching and find_text
failed to parse OCR JSON when the screen showed symbols like a bullet or
arrow, because PowerShell wrote the OEM code page.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@TMHSDigital
TMHSDigital merged commit a8d7949 into main Oct 25, 2026
8 checks passed
@TMHSDigital
TMHSDigital deleted the fix/powershell-utf8 branch October 25, 2026 13:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant