Uh oh!
There was an error while loading. Please reload this page.
fix: specify UTF-8 encoding for Buffer.toString() on Windows - Issue #10341 - #10381
fix: specify UTF-8 encoding for Buffer.toString() on Windows - Issue #10341#10381Luckybalabala wants to merge 1 commit into
Conversation
The following comment was made by an LLM, it may be inaccurate: No duplicate PRs found |
684dc05 to
0dec888Comparerekram1-node
commented
Jan 24, 2026
Can u explain why this fixes that scoop issue you cite? |
Luckybalabala
commented
Jan 24, 2026
Why this should fix the Scoop issueThe issue appears to be related to Windows system encoding differences: Problem Context1. Windows Default Encoding ≠ UTF-8 2. // Without encoding parameter → uses SYSTEM default encodingconststr=data.toString()// Windows: CP1252, Linux: UTF-8// WITH encoding parameter → attempts to use specified encodingconststr=data.toString('utf8')// Should use UTF-83. Example of the Issue constbuf=Buffer.from([0xE4,0xBD,0xA0]);// UTF-8 bytes for "你"// On Windows (CP1252):buf.toString()// → "ä½ " (likely garbled)buf.toString('utf8')// → "你" (expected output)// On Linux (UTF-8):buf.toString()// → "你" (coincidentally works)buf.toString('utf8')// → "你" (explicitly specified)Why Scoop Installations May Be Affected
The Proposed FixBy explicitly specifying - const str = data.toString()+ const str = data.toString('utf8')The intention is to request UTF-8 behavior across platforms, reducing dependency on system defaults. Expected Impact
This is a targeted fix for Windows compatibility, particularly for Scoop installations where users have reported encoding issues. Note: Testing on actual Windows/Scoop installations would help confirm this addresses the reported issue. References: |
amelvil2-ford
commented
Jan 30, 2026
Just wondering, why was this PR closed? |
Problem
Non-ASCII characters displayed incorrectly on Windows (Scoop installations), showing garbled Unicode characters.
Root Cause:
Buffer.toString()uses the system's default encoding:Solution
Explicitly specify UTF-8 encoding in two locations:
File:
src/cli/cmd/tui/util/terminal.tsFile:
src/cli/cmd/tui/app.tsxImpact
Testing
Fixes#10341 - Critical Windows compatibility bug