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

Powershell 7.4.0 输出乱码 #185

Open
Feiyuyu0503 opened this issue Dec 2, 2023 · 4 comments
Open

Powershell 7.4.0 输出乱码 #185

Feiyuyu0503 opened this issue Dec 2, 2023 · 4 comments

Comments

@Feiyuyu0503
Copy link

以前也遇到过这个问题,但查看相关issue #135 后升级powershell到v7 可正常使用。但是最近发现(似乎powershell自动升了个小版本?)输出又乱码了(使用--gbk正常)且必须等待命令执行结束之后才有输出显示出来。
Powershell v7.4.0
nali v0.8.0

@zu1k
Copy link
Owner

zu1k commented Dec 2, 2023

最新的 master 分支有这个问题吗

@Feiyuyu0503
Copy link
Author

go install github.com/zu1k/nali@master

我这样安装的,替换了原来的nali.exe,问题依然存在

@zu1k
Copy link
Owner

zu1k commented Dec 3, 2023

看起来 PS 7.4 又改变编码了,这还导致 oh-my-posh 出现问题,可以通过以下命令查看你的 PS 的编码方式。

[console]::InputEncoding; [console]::OutputEncoding

暂时的建议是用 cmd,加 --gbk

@Feiyuyu0503
Copy link
Author

看起来 PS 7.4 又改变编码了,这还导致 oh-my-posh 出现问题,可以通过以下命令查看你的 PS 的编码方式。

[console]::InputEncoding; [console]::OutputEncoding

暂时的建议是用 cmd,加 --gbk

多谢作者回复。我确实也用了oh-my-posh,在cmd下加--gbk一切正常。Powershell查看编码方式内容如下:

# [console]::InputEncoding; [console]::OutputEncoding

EncodingName      : Chinese Simplified (GB2312)
WebName           : gb2312
HeaderName        : gb2312
BodyName          : gb2312
Preamble          :
WindowsCodePage   :
IsBrowserDisplay  :
IsBrowserSave     :
IsMailNewsDisplay :
IsMailNewsSave    :
IsSingleByte      : False
EncoderFallback   : System.Text.InternalEncoderBestFitFallback
DecoderFallback   : System.Text.InternalDecoderBestFitFallback
IsReadOnly        : True
CodePage          : 936

EncodingName      : Chinese Simplified (GB2312)
WebName           : gb2312
HeaderName        : gb2312
BodyName          : gb2312
Preamble          :
WindowsCodePage   :
IsBrowserDisplay  :
IsBrowserSave     :
IsMailNewsDisplay :
IsMailNewsSave    :
IsSingleByte      : False
EncoderFallback   : System.Text.InternalEncoderBestFitFallback
DecoderFallback   : System.Text.InternalDecoderBestFitFallback
IsReadOnly        : False
CodePage          : 936

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants