MiMo-Code icon indicating copy to clipboard operation
MiMo-Code copied to clipboard

windows 11中,执行 powershell 时乱码

Open jesse51076008 opened this issue 5 months ago • 5 comments

Description

当前目录有中文文件夹和文件,然后提示词【调用powershell列出当前目录的文件和文件夹】,显示的文件名有乱码

Image

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

jesse51076008 avatar Jun 12 '26 15:06 jesse51076008

把系统改为UTF-8就好了,我试过

Image

FrecklyComb1728 avatar Jun 12 '26 17:06 FrecklyComb1728

#267 这个类似的issue已经提出了,并且已经提PR了。

senguangd avatar Jun 13 '26 08:06 senguangd

这属于win系统终端编码问题。在opencode上就有乱码

2646601154 avatar Jun 13 '26 16:06 2646601154

这属于win系统终端编码问题。在opencode上就有乱码

可以用下Kilo Code,我提交PR修复了。

senguangd avatar Jun 14 '26 02:06 senguangd

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 模式两条路径都覆盖),列含中文文件名的目录已正常显示。将随下个版本发布。

yanyihan-xiaomi avatar Jun 28 '26 07:06 yanyihan-xiaomi