Skip to content
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

输入中文后变乱码 #74

Open
brucmao opened this issue Jun 5, 2023 · 3 comments
Open

输入中文后变乱码 #74

brucmao opened this issue Jun 5, 2023 · 3 comments
Labels
bug Something isn't working windows

Comments

@brucmao
Copy link

brucmao commented Jun 5, 2023

输入中文后,显示在控制台是乱码,比如我输入你好,显示在控制台是

浣犲ソ
image

windows 11
terminal preview
PowerShell 7.3.4

@j178 j178 added bug Something isn't working windows labels Jun 5, 2023
@j178
Copy link
Owner

j178 commented Jun 5, 2023

经典的 GBK 编码问题,我研究下怎么解决

image

Ref: https://zhuanlan.zhihu.com/p/138590745

@j178
Copy link
Owner

j178 commented Jun 5, 2023

因为底层依赖 bubbletea 目前只支持 UTF8,所以这个编码问题在我这一侧暂时无解。不过从你的角度可以通过修改 code page 为 utf8 来解决,相关链接:https://stackoverflow.com/questions/57131654/using-utf-8-encoding-chcp-65001-in-command-prompt-windows-powershell-window

@ghost
Copy link

ghost commented Mar 23, 2024

powershell:

code $profile

添加一下配置

[System.Console]::OutputEncoding=[System.Text.Encoding]::GetEncoding(65001)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working windows
Projects
None yet
Development

No branches or pull requests

2 participants