- How you use it
- A setting in your project
- What it can do
- writes files · runs shell
- What's inside
The option
| Option | AConfig · v1.0.0Process-local CJK UTF-8 shell probe |
|---|---|
| How you use it | A setting in your project |
| What it can do | writes files · runs shell |
| What's inside |
What this thread does
Try setting the encoding in the same Agent shell invocation that produces the garbled output, then compare a known Unicode sample.
Do first: run [Console]::OutputEncoding.CodePage in the failing Agent shell.
CLI v2026.10.22 documents UTF-8 PowerShell execution and IDE 3.27 documents non-ASCII chunk-decoding fixes (CLI notes, IDE notes); neither establishes a complete repair for every native executable (checked 2026-11-05).
Diagnostic: CJK output becomes mojibake in the Agent shell
1. Run [Console]::OutputEncoding.CodePage inside the failing Agent tool call, not only in an interactive terminal. 2. For a process-local experiment, prepend this to the affected command:
[Console]::InputEncoding = [System.Text.UTF8Encoding]::new($false)
[Console]::OutputEncoding = [System.Text.UTF8Encoding]::new($false)
$OutputEncoding = [Console]::OutputEncoding
3. In that same invocation, print [Console]::OutputEncoding.CodePage; expect 65001. Then run the original read-only command against text whose contents you already know. Check both its visible CJK output and the text received by Agent. A correct code-page number alone does not prove the output round trip works. 4. If file reading alone is wrong, try Get-Content -Encoding UTF8 for a file known to be UTF-8. Do not rewrite files merely to repair their display.
The preamble is a proposed mitigation, untested for the reported Cursor build. If setting an encoding is prohibited by the shell's language restrictions, stop that experiment rather than changing the security policy. A new shell process may need its own preamble. A prompt rule can request it but cannot enforce execution.
Why these are separate checks
Microsoft's character-encoding documentation distinguishes console/pipeline encoding from file encoding. Windows PowerShell has inconsistent file-output defaults and may read BOM-less UTF-8 as a legacy encoding. PowerShell 6 and later default text output to UTF-8 without a BOM. Those defaults do not establish how Cursor decodes a particular native process's bytes.
Evidence
Tianyu_Li reported the symptom on October 26, 2026: “output from native executables” is affected in their setup (report). Their request proposes wrapper-level encoding changes; it does not demonstrate that this preamble fixes every tool. Colin's October 27 reply says the UTF-8 wrapper can be skipped for a whole chat on 3.27.14 and recommends turning Legacy Terminal Tool off; it names no fixed patch.
Limits
Checked 2026-10-28. No Windows round-trip trial was run. This cannot repair bytes already corrupted in a file, force legacy programs to emit UTF-8, or fix missing font glyphs. Not for: file-save corruption or an editor's encoding conversion workflow.
Started from a post by @Tianyu_Li, packaged by the editor. Original post
- 01 · YouPaste the line from Try it into your agent.
- 02 · Your agentGets the package and a trial ticket, installs it on a new branch, runs its check.
- 03 · YouApprove a one-line report. Nothing is posted without you.