claude-code - 💡(How to fix) Fix PowerShell output displays garbled text on Windows when system codepage is Big5 (950) [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#46486Fetched 2026-04-11 06:19:01
View on GitHub
Comments
1
Participants
2
Timeline
4
Reactions
0
Author
Timeline (top)
labeled ×3commented ×1

On Windows systems with system codepage set to Big5 (950), Claude Code executing PowerShell commands produces garbled output for multi-byte characters (Japanese, Traditional Chinese, Korean, etc.). This affects user experience in non-English regions.

Root Cause

On Windows systems with system codepage set to Big5 (950), Claude Code executing PowerShell commands produces garbled output for multi-byte characters (Japanese, Traditional Chinese, Korean, etc.). This affects user experience in non-English regions.

Fix Action

Fix / Workaround

Current Workaround

This can be resolved by creating a wrapper script:

Code Example

powershell.exe -NoProfile -Command "Write-Host 'テスト中文'"

---

# Create pwshutf8 wrapper
#!/bin/bash
powershell.exe -NoProfile -Command "[Console]::OutputEncoding=[Text.Encoding]::UTF8;$OutputEncoding=[Text.Encoding]::UTF8; $1"

---

{
  "shell": {
    "powershell": {
      "encoding": "utf-8"
    }
  }
}
RAW_BUFFERClick to expand / collapse

Description

On Windows systems with system codepage set to Big5 (950), Claude Code executing PowerShell commands produces garbled output for multi-byte characters (Japanese, Traditional Chinese, Korean, etc.). This affects user experience in non-English regions.

Environment

  • OS: Windows 11 Pro 10.0.26200
  • System Codepage: 950 (Big5)
  • Shell: Git Bash (MSYS2)
  • Claude Code Version: v2.x

Steps to Reproduce

  1. Install Claude Code on Windows
  2. Execute PowerShell command with multi-byte characters:
    powershell.exe -NoProfile -Command "Write-Host 'テスト中文'"
  3. Expected output: テスト中文
  4. Actual output: garbled text (e.g., �����)

Current Workaround

This can be resolved by creating a wrapper script:

# Create pwshutf8 wrapper
#!/bin/bash
powershell.exe -NoProfile -Command "[Console]::OutputEncoding=[Text.Encoding]::UTF8;$OutputEncoding=[Text.Encoding]::UTF8; $1"

However, this is not an ideal solution as it requires manual configuration by users.


Proposed Solutions

Option 1: Add Configuration Setting

Add encoding-related configuration to settings.json:

{
  "shell": {
    "powershell": {
      "encoding": "utf-8"
    }
  }
}

Option 2: Automatic Detection and Setting

Claude Code automatically detects system codepage and sets correct output encoding when executing PowerShell commands.

Option 3: Change Default Behavior

Default to UTF-8 encoding, with Big5 as fallback.


Impact

  • All Claude Code users on Windows in non-English regions (using Big5, EUC-KR, etc.)
  • Users who use PowerShell as their primary shell

Additional Notes

extent analysis

TL;DR

Set the output encoding to UTF-8 when executing PowerShell commands to resolve garbled output for multi-byte characters.

Guidance

  • Verify that the system codepage is set to Big5 (950) and that the issue reproduces with the provided PowerShell command.
  • Consider implementing Option 1: Add an "encoding" configuration setting to settings.json to specify UTF-8 encoding for PowerShell commands.
  • Test the proposed workaround using the pwshutf8 wrapper script to confirm that setting the output encoding to UTF-8 resolves the issue.
  • Evaluate the feasibility of Option 2: Automatic Detection and Setting, which would require Claude Code to detect the system codepage and set the correct output encoding.

Example

powershell.exe -NoProfile -Command "[Console]::OutputEncoding=[Text.Encoding]::UTF8;$OutputEncoding=[Text.Encoding]::UTF8; Write-Host 'テスト中文'"

Notes

The issue is not a bug in Claude Code, but rather a system-level limitation of the Windows + PowerShell + Git Bash combination. Changing the system codepage can affect other applications.

Recommendation

Apply the workaround by setting the output encoding to UTF-8, as this is a straightforward solution that can be implemented without modifying the system codepage or relying on automatic detection.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING