[PR #11459] fix(pty): Add UTF-8 encoding defaults for Windows PTY #13798

Closed
opened 2026-02-16 18:18:37 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/11459

State: closed
Merged: Yes


Fix Chinese Character Display Issues in Windows PTY

Problem Description

This PR fixes issue #9793 where Chinese characters are displayed as garbled text in CLI mode on Windows terminals.
Fixes #9793

Root Cause

The Windows PTY process was missing UTF-8 encoding environment variables, causing CJK characters to render incorrectly.

Solution

Set UTF-8 encoding environment variables for Windows platform:

  • LC_ALL=C.UTF-8
  • LC_CTYPE=C.UTF-8
  • LANG=C.UTF-8

Related Issues

  • #9793: Chinese characters displayed as garbled text in CLI mode
  • #9790: Process killed with garbled output when dragging terminal window
  • #9787: Occasional process killed with garbled output
  • #8410: TUI icons show as garbage characters on Windows 10
  • #7891: OpenCode TUI Chinese Text Display Issue

Related PR

  • #10489: fix(pty): Add UTF-8 defaults for Windows PTY

Changes

  • Modified packages/opencode/src/pty/index.ts to add UTF-8 locale settings for Windows

Testing

Test Chinese character display in Windows PowerShell terminal to verify the fix works correctly.

**Original Pull Request:** https://github.com/anomalyco/opencode/pull/11459 **State:** closed **Merged:** Yes --- ## Fix Chinese Character Display Issues in Windows PTY ### Problem Description This PR fixes issue #9793 where Chinese characters are displayed as garbled text in CLI mode on Windows terminals. Fixes #9793 ### Root Cause The Windows PTY process was missing UTF-8 encoding environment variables, causing CJK characters to render incorrectly. ### Solution Set UTF-8 encoding environment variables for Windows platform: - LC_ALL=C.UTF-8 - LC_CTYPE=C.UTF-8 - LANG=C.UTF-8 ### Related Issues - #9793: Chinese characters displayed as garbled text in CLI mode - #9790: Process killed with garbled output when dragging terminal window - #9787: Occasional process killed with garbled output - #8410: TUI icons show as garbage characters on Windows 10 - #7891: OpenCode TUI Chinese Text Display Issue ### Related PR - #10489: fix(pty): Add UTF-8 defaults for Windows PTY ### Changes - Modified packages/opencode/src/pty/index.ts to add UTF-8 locale settings for Windows ### Testing Test Chinese character display in Windows PowerShell terminal to verify the fix works correctly.
yindo added the pull-request label 2026-02-16 18:18:37 -05:00
yindo closed this issue 2026-02-16 18:18:37 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#13798