GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Fix CJK character display issues in Windows terminals · Issue #10491 · anomalyco/opencode

Fix CJK character display issues in Windows terminals #10491

New issue
Copy link
New issue
Copy link
Closed as not planned
Closed as not planned
Fix CJK character display issues in Windows terminals#10491
Copy link
Assignees
rekram1-node

Description

@Observer-GGboy
Observer-GGboy
opened on Jan 25, 2026
Issue body actions

Problem

OpenCode terminals on Windows do not properly display CJK (Chinese, Japanese, Korean) characters. Instead, they appear as gibberish, question marks, or cause encoding errors.

Affected Scenarios

  1. Terminal Output

    $ echo "你好世界"
    ?????
    
  2. Python Scripts

    $ python -c "print('你好')"
    UnicodeEncodeError: 'ascii' codec can't encode characters
    
  3. Git Operations

    $ git status
    ?? "\346\226\346\231\230.md"
    

Root Cause

Windows historically uses GBK/GB2312 encoding by default, not UTF-8. This causes issues when:

  • Terminal code page is not set to UTF-8 (CP65001)
  • Environment variables (LANG, LC_ALL) are not configured
  • Python's UTF-8 mode is not enabled
  • Shell encoding (PowerShell/CMD) is not configured

Proposed Solution

Add platform-specific UTF-8 defaults for Windows PTY (pseudo-terminal) creation:

  1. Environment Variables

    • Set LANG=en_US.UTF-8
    • Set LC_ALL=en_US.UTF-8
    • Set PYTHONUTF8=1 (Python 3.7+)
    • Set PYTHONIOENCODING=utf-8
  2. Shell Startup Arguments

    • CMD.exe: Run chcp 65001 to set code page to UTF-8
    • PowerShell: Configure OutputEncoding and InputEncoding to UTF-8

Impact

  • Target Platform: Windows only (no impact on macOS/Linux)
  • User-Visible: Yes (fixes CJK character display)
  • Backwards Compatible: Yes (only sets defaults, users can override via env parameter)

Related

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

Activity

  1. github-actions
    assigned
    rekram1-node
    on Jan 25, 2026
  2. github-actions
    added
    windows
    on Jan 25, 2026
  3. github-actions commented on Jan 25, 2026

    @github-actions
    github-actionsBot
    on Jan 25, 2026 – with GitHub Actions
    Contributor
    More actions

    This issue might be a duplicate of existing issues. Please check:

    • OpenCode crashes during use on Windows (garbled console output) #10414: OpenCode crashes during use on Windows (garbled console output) - Similar garbled output on Windows
    • Chinese Characters #10486: Chinese Characters - CJK characters appearing unexpectedly in output
    • Garbled characters appear after launching the program on Windows system. #9814: Garbled characters appear after launching the program on Windows system
    • Ctrl+C during response causes terminal to print endless garbage and become unresponsive #10265: Ctrl+C during response causes terminal to print endless garbage and become unresponsive - Related terminal encoding issue
    • Scoop-fixes-opencode-windows-x64-garbled-output-issue-but-cause-unknown #10341: Scoop-fixes-opencode-windows-x64-garbled-output-issue-but-cause-unknown - Windows-specific garbled output issue
    • 命令行模式下中文显示突然全部变成乱码 #9793: 命令行模式下中文显示突然全部变成乱码 (Chinese characters display as garbled in CLI mode) - CJK display issue on Windows
    • Undo/revert fails for files with non-ASCII filenames on Windows #10210: Undo/revert fails for files with non-ASCII filenames on Windows - Related non-ASCII handling issue

    Feel free to ignore if none of these address your specific case.

  4. FIXUAI commented on Mar 24, 2026

    @FIXUAI
    FIXUAI
    on Mar 24, 2026
    More actions

    I can reproduce a similar issue on OpenCode Desktop 1.3.0 on Windows.

    This is not only TUI input/rendering for CJK. I also get garbled Chinese output when Desktop runs terminal commands through the built-in shell tool.

    Repro:

    1. Open OpenCode Desktop on Windows
    2. Run a command like where docker
    3. If Windows returns a localized Chinese message, the output is garbled

    Example output:
    ��Ϣ: ���ṩ��ģʽ�޷��ҵ��ļ���

    Expected:

    • Chinese output is displayed correctly

    Actual:

    • Chinese output is mojibake / incorrectly decoded

    Relevant evidence:

    • Log path: C:\Users\fixui\.local\share\opencode\log\2026-03-23T043957.log:108
    • Log line: service=bash-tool shell=cmd.exe bash tool using shell

    So this seems related to Windows shell/code-page handling for cmd.exe output in Desktop as well, not only TUI text rendering.

    Happy to test a fix if needed.

  5. thdxr
    removed
    windows
    on May 3, 2026
  6. github-actions commented on Jul 6, 2026

    @github-actions
    github-actionsBot
    on Jul 6, 2026 – with GitHub Actions
    Contributor
    More actions

    To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.

  7. github-actions
    closed this as not plannedon Jul 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @rekram1-node
    rekram1-node

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.