Agent `gh pr create --body-file` corrupts Unicode on Windows

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

Agent gh pr create --body-file corrupts Unicode on Windows

Environment

  • OS: Windows 10/11
  • Shell: PowerShell
  • Tooling: Cursor Agent ran gh pr create --repo ¡­ --body-file .pr-body-tmp.md

Expected

PR description on GitHub matches the markdown file (e.g. #2 ¡ª Upgrade, job ¡ª vcpkg, Arc ¡ú ArcShape).

Actual

Non-ASCII punctuation in the body file was stored on GitHub as replacement characters ``:

  • ¡ª (U+2014 EM DASH) ¡ú ``
  • ¡ú (U+2192 RIGHTWARDS ARROW) ¡ú ``

Example from a real PR:

**Depends on:** [#2 Upgrade txiki to v26.5.0](...)

instead of:

**Depends on:** [#2 ¡ª Upgrade txiki to v26.5.0](...)

Steps to reproduce

  1. On Windows, have the agent write a PR body file containing Unicode punctuation (¡ª, ¡ú, etc.).
  2. Run gh pr create --body-file <path>.
  3. Open the PR on GitHub and inspect the description.

Workaround

  • Use ASCII-only in PR bodies when the agent uses --body-file on Windows (- instead of ¡ª, to instead of ¡ú).
  • Or ensure UTF-8 end-to-end (e.g. UTF-8 with BOM for the body file, chcp 65001, [Console]::OutputEncoding = [System.Text.UTF8Encoding]::new() before gh).

Suggestion

When the agent writes temp files for gh on Windows, either force UTF-8 with BOM or avoid Unicode in generated PR/commit bodies unless encoding is verified through the full pipeline (Write tool ¡ú disk ¡ú gh ¡ú GitHub API).

Steps to Reproduce

  1. On Windows, have the agent write a PR body file containing Unicode punctuation (, , etc.).
  2. Run gh pr create --body-file <path>.
  3. Open the PR on GitHub and inspect the description.

Expected Behavior

PR description on GitHub matches the markdown file (e.g. #2 — Upgrade, job — vcpkg, Arc → ArcShape).

Operating System

Windows 10/11

Version Information

Version: 3.6.21 (system setup)
VS Code Extension API: 1.105.1
Commit: e7a7e93f4d75f8272503ecf33cedbaae10114a10
Date: 2026-05-28T21:45:36.072Z
Layout: editor
Build Type: Stable
Release Track: Default
Electron: 39.8.1
Chromium: 142.0.7444.265
Node.js: 22.22.1
V8: 14.2.231.22-electron.0
xterm.js: 6.1.0-beta.220
OS: Windows_NT x64 10.0.26100

Does this stop you from using Cursor

No - Cursor works, but with this issue

Hey, thanks for the detailed report with repro steps and the workaround. This is a known bug. On Windows, the agent Write and StrReplace tools save files in the wrong encoding, UTF-16 LE or the system code page, instead of UTF-8. Then gh pr create --body-file reads them as UTF-8, which breaks Unicode punctuation. The issue is reported internally, but I can’t share a fix timeline yet.

Your workaround is solid. Until this is fixed, the best option is either to keep PR and commit bodies in ASCII, use - instead of -- and to instead of ->, or force UTF-8 through the whole pipeline, run chcp 65001 plus [Console]::OutputEncoding = [System.Text.UTF8Encoding]::new() before gh.

These threads describe the same issue if you want to follow along:

I’ll reply once there’s an update on the fix.