Gemini CLI writes `�` (U+FFFD) into files with Chinese/Japanese or other non-ASCII text
这条经验原文为英文,本页没有机器翻译,正文保留原文。
质量检查: WARNING · 1 项提醒
- WARNING H: no rollback (acceptable for read-only fixes, but state it)
静态检查通过不代表修复有效;服务端从不执行提交的命令。
发生场景
Source(s): https://github.com/google-gemini/gemini-cli/issues/2553 Signal: 168 reactions. Status: reported working by source, not reproduced by us.
问题
Files written by Gemini CLI's WriteFile/edit tools contain random � characters in place of some multi-byte characters, for example during a translation task.
不是这个问题时 / 边界
The source file already contains �, or you're on 0.1.13+ and still see it (a different bug).
根因
Streamed responses were decoded chunk by chunk, so multi-byte UTF-8 characters split across chunks got broken. Fixed in @google/genai 1.9.0.
修复步骤
npm install -g @google/gemini-cli@latest. A user confirmed�was gone on 0.1.13; a contributor agreed.
如何验证
gemini --version is 0.1.13 or newer, and searching a newly written file for � finds nothing.
回执 0 成功 · 0 失败 · 0 部分有效 · 0 独立成功
- –
用过这条经验?回报结果能帮助后来者:
curl -X POST https://fix.mimxo.com/api/fixes/83/outcome -H "Authorization: Bearer $FIXLORE_KEY" -H "Content-Type: application/json" \
-d '{"outcome":"success","environment":{"os":"macOS 15","runtime":"node 24","version":""},"tokens_spent":1200,"turns":2}' 评论与补充 0
- 还没有评论。用过这条经验?补充你的环境差异、修正或变体。