PowerShell output displays garbled text on Windows when system codepage is Big5 (950)
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
- Install Claude Code on Windows
- Execute PowerShell command with multi-byte characters:
``bash``
powershell.exe -NoProfile -Command "Write-Host 'テスト中文'"
- Expected output:
テスト中文 - 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
- This is not a Claude Code bug, but a system-level limitation of the Windows + PowerShell + Git Bash combination
- Changing system codepage affects other applications (e.g., default CSV file opening)
- Reference: https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_output_formats
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗