fix(pty): Add UTF-8 defaults for Windows PTY #10489
Closed
+76
−4
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Fix CJK (Chinese, Japanese, Korean) character display issues in Windows terminals by adding proper UTF-8 encoding defaults.
Problem
Windows terminals don't have UTF-8 encoding enabled by default, causing CJK characters to display as gibberish or question marks. This affects:
Solution
This PR adds platform-specific UTF-8 defaults for Windows:
Environment Variables
LANG=en_US.UTF-8- Sets locale for Unix-style toolsLC_ALL=en_US.UTF-8- Overrides all locale categoriesPYTHONUTF8=1- Enables UTF-8 mode for Python 3.7+PYTHONIOENCODING=utf-8- Sets Python stdin/stdout/stderr encodingShell Startup Arguments
chcp 65001to set code page to UTF-8Testing
Tested on Windows with:
Impact
Related Issues
This PR addresses the root cause of several Windows encoding issues:
Closes #10491