windows 11中,执行 powershell 时乱码
Description
当前目录有中文文件夹和文件,然后提示词【调用powershell列出当前目录的文件和文件夹】,显示的文件名有乱码
Plugins
No response
OpenCode version
No response
Steps to reproduce
No response
Screenshot and/or share link
No response
Operating System
No response
Terminal
No response
把系统改为UTF-8就好了,我试过
#267 这个类似的issue已经提出了,并且已经提PR了。
这属于win系统终端编码问题。在opencode上就有乱码
这属于win系统终端编码问题。在opencode上就有乱码
可以用下Kilo Code,我提交PR修复了。
Fixed by #1418 (merged in aae0243).
On non-UTF-8 Windows locales (e.g. zh-CN, code page 936/GBK), shell subprocesses emitted output in the legacy code page which we decoded as UTF-8 → mojibake. We now force UTF-8 output for spawned PowerShell/cmd subprocesses (both the model's bash tool and the TUI shell mode). Listing a directory with Chinese filenames now renders correctly. This will ship in the next release.
中文:已由 #1418 修复(合并于 aae0243)。在非 UTF-8 区域(如简体中文,代码页 936/GBK)下,子进程按旧代码页输出、我们按 UTF-8 解码导致乱码;现已为 PowerShell/cmd 子进程强制开启 UTF-8 输出(模型的 bash 工具与 TUI shell 模式两条路径都覆盖),列含中文文件名的目录已正常显示。将随下个版本发布。