Windows Shell Encoding Doctor - Windows Shell编码修复工具
Installation
SKILL.md
Windows Shell 与编码排障
在 Windows 上排查 PowerShell / cmd / Git Bash 下的命令失败、乱码与换行问题。先识别 当前 shell,再归类:shell 混用、引号与转义、编码与 code page、路径与空格、CRLF/LF。用 可粘贴命令 与 references 中的清单/剧本修复;写无 BOM UTF-8 见正文与 encoding-checklist.md 中的 [System.IO.File]::WriteAllText 示例。不要一上来盲改命令。
何时使用本技能
- bash 命令在 PowerShell 里报错(heredoc、
export、grep | xargs等) - PowerShell 语法误贴在 Git Bash / cmd 里
- Windows 下中文乱码、
\uXXXX字面量、mojibake、控制台编码 - PowerShell 里安全传 JSON、多行 payload、stdin
- 路径明明存在却找不到(未加引号、工作目录错、分隔符习惯)
- 脚本在 Windows 编辑后到 Linux 失效(CRLF、BOM)
- 文档或 Agent 给的 Linux 一键命令在本地 PowerShell 粘贴失败
典型问法示例:「这个 bash 命令在 PowerShell 为什么报错?」「同样命令在 Linux 能跑,Windows 不行。」