-
Notifications
You must be signed in to change notification settings - Fork 8.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to set UTF-8 in Windows Terminal #11956
Comments
You gotta give us more details - what shell you're using, what OS version, what Terminal version, etc. etc. |
With code page 65001, even Terminal Preview 1.12.2931.0 reads non-ASCII characters as null bytes. Who knows when Terminal and conhost will support UTF-8 properly. For now, implement a layer that translates between UTF-8 and UTF-16, and call |
This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment. |
The console API doesn't support reading input as UTF-8, so it's a half-baked implementation. It only supports UTF-8 output, and that's only implemented properly for buffered writes in recent versions of conhost. Reading input as UTF-8 is limited to ASCII, which is still the case even with Windows 11 and Windows Terminal Preview 1.12.3472.0. For example, here's a low-level >>> s = os.read(0, 10)
こんにちわ
>>> s
b'\x00\x00\x00\x00\x00\r\n' Non-ASCII characters are replaced by null characters because the console's |
This sounds like an issue with either PowerShell itself, or PSReadline, which should be filed over at https://github.com/powershell/powershell or https://github.com/powershell/psreadline. I'd suspect that updating to the latest version of both of those might just automatically fix this for you, I don't think PowerShell 5& PSReadline 2 (which ships with Windows) supported utf-8 input. |
CHCP 65001 has no effect, how do I set the terminal to UTF-8
The text was updated successfully, but these errors were encountered: