AI Agent Hub
Back to plugins
🖥️

dsh-pwsh-encoding-fix

Client Updated 2026.08.15

Run the following command in DeepSeek Harness:

dsh plugin install hongweifei/dsh-pwsh-encoding-fix

Paste the following prompt into your AI chat to install this plugin:

Run dsh plugin install hongweifei/dsh-pwsh-encoding-fix in the DSH terminal to install this plugin; the full source code is available at https://github.com/hongweifei/dsh-pwsh-encoding-fix

About this plugin

On Chinese Windows, native programs disagree on output encoding: ipconfig and javac write GBK, while node, Maven 3.9+, and Gradle 9 write UTF-8. DSH's pwsh tool decodes everything as UTF-8 by default, so any single fixed interpretation leaves half the programs garbled. dsh-pwsh-encoding-fix resolves this conflict at the source.

Inside the PowerShell process, the plugin switches the console encoding to Latin-1, a strictly one-byte-per-codepoint scheme that preserves every byte written by native programs without loss. After capture, each segment is heuristically decoded: strict UTF-8 is attempted first, falling back to the system ANSI code page on failure. Mixed GBK and UTF-8 output within a single command is handled segment by segment, and the result is re-emitted as UTF-8 so the Node-side collector decodes it correctly. Command exit codes ($LASTEXITCODE) are preserved, the wrapper works for both foreground run and background start, and only the PowerShell executor is affected.

This plugin is ideal for developers on Chinese Windows who use DSH's pwsh tool alongside encoding-sensitive tools such as ipconfig, systeminfo, javac, node, Maven, or Gradle, and want a permanent fix for garbled output without manually switching chcp or guessing each program's encoding.

Use Cases

  • Running GBK-output programs like ipconfig or javac via DSH pwsh tool on Chinese Windows shows garbled text
  • A single command mixes node (UTF-8) and systeminfo (GBK), making part of the output unreadable
  • Maven or Gradle build diagnostics appear as mojibake in the pwsh tool output

Best For

  • Daily developers using DSH pwsh tool on Chinese Windows
  • Script authors who mix GBK and UTF-8 output from different programs in one command
  • Users who want a permanent fix for DSH output encoding instead of manually switching code pages