Install
openclaw skills install @jvy/powershellopenclaw skills install @jvy/powershellOn Chinese Windows systems, the PowerShell console and redirection operators (>, >>) often use the system default encoding (GBK / code page 936). Writing UTF-8 text through PowerShell can silently corrupt Chinese characters into garbled text.
Do not use PowerShell to write or overwrite files:
echo "..." > file.txtecho "..." >> file.txtSet-Content file.txt "..."Out-File file.txt without explicit -Encoding UTF8These methods are unreliable because encoding defaults vary by locale and PowerShell version.
Always use the dedicated file tools:
WriteFile for creating or overwriting filesStrReplaceFile for editing existing filesThese tools write UTF-8 deterministically and avoid shell encoding pitfalls.
If a script or command must write files through PowerShell, force UTF-8 explicitly:
"content" | Out-File -FilePath "file.txt" -Encoding UTF8
Or use .NET directly:
[System.IO.File]::WriteAllText("file.txt", "content", [System.Text.Encoding]::UTF8)
Always verify the produced file is readable and not garbled before finishing.
Check the active console code page:
chcp
If it returns 936, PowerShell redirection is especially unsafe for UTF-8 content. Fall back to file tools.