Where does the bug appear (feature/product)?
Cursor IDE
Describe the Bug
On Windows, Cursor runs a hook through a PowerShell wrapper that reads the JSON payload file with Get-Content -LiteralPath <payload> -Raw and no -Encoding argument. On Windows PowerShell 5.1 a file without a byte-order mark is read as the ANSI code page, so every non-ASCII character in the payload arrives at the hook process double-encoded: “é” (UTF-8 c3 a9) reaches stdin as c3 83 c2 a9. Cursor’s own hook log records the same text intact. The hook has no way to tell this happened.
The wrapper, as Cursor logs it:
$OutputEncoding = [System.Text.Encoding]::UTF8; Get-Content -LiteralPath ‘\cursor-hooks-\payload.json’ -Raw | & { $input | & ‘’ }
Fix is one token on your side: Get-Content … -Raw -Encoding UTF8, or write the payload with a BOM, or pass it on stdin directly.
Steps to Reproduce
- Windows 11, Windows PowerShell 5.1 (no pwsh 7 installed).
- Install a preToolUse (or beforeShellExecution) hook in ~/.cursor/hooks.json that runs an executable which dumps its stdin bytes to a file.
- In the Agent, send a prompt containing non-ASCII text, e.g.
café 東京 naïve, so that the model’s reasoning or a tool input quotes it. - Compare the bytes the hook received with the same text in Cursor’s hook log (%APPDATA%\Cursor\logs<date>\window*\output_\cursor.hooks..log).
Expected Behavior
The hook receives the payload bytes Cursor logged: “café” as 63 61 66 c3 a9.
Operating System
Windows 10/11
Version Information
Cursor IDE 3.21.9 (9998796a6096ce83d83a9332bfe7473b985db750), vscode 1.128.0
Also reproduced on 3.21.16
Windows 11 Home 10.0.26200.9457
Windows PowerShell 5.1.26100.9444 (Desktop edition)
For AI issues: which model did you use?
grok-4.6 (agent mode). The model is not the cause; the wrapper is.
For AI issues: add Request ID with privacy disabled
Not available: the conversation was on a test machine and has since been cleared.
Cursor’s own hook log identifies it as workspace/conversation 96bcf583 on 2026-09-21,
10:47–10:48 UTC. The bug reproduces from the steps above without it.
Additional Information
Actual bytes received by the hook for the same sentence: 63 61 66 c3 83 c2 a9 20 c3 a6 c2 9d c2 b1 c3 a4 c2 ba c2 ac 20 6e 61 c3 83 c2 af 76 65 (29 bytes for 19 characters). Cursor’s hook log, same sentence: 63 61 66 c3 a9 20 e6 9d b1 e4 ba ac 20 6e 61 c3 af 76 65 (19 bytes). Reproduced on two sittings, 2026-09-18 and 2026-09-21. Machines with PowerShell 7 as the default would not show it, since pwsh defaults to UTF-8.
No request id is attached; this is not a model-output issue and it reproduces
deterministically from the steps.
Does this stop you from using Cursor
No - Cursor works, but with this issue