Where does the bug appear (feature/product)?
Cursor IDE
Describe the Bug
Environment:
- OS: Windows 11
- Cursor Version: 2.4.22
- System Locale: Russian
Description:
Hook scripts receive malformed JSON on stdin where Cyrillic characters
are replaced with ???. The encoding corruption happens before the hook
script executes - it’s not a script-side issue.
Known bug reports:
- Windows: Cursor hooks corrupt Chinese UTF-8 characters in stdin
- On Windows, Chinese prompt in hooks stdin becomes ??? while execution log shows correct text
Steps to Reproduce
Reproduction:
- Create hooks.json with sessionStart hook
- Create Python script that logs stdin to file
- Start composer session with Russian prompt
- Check log - Cyrillic appears as
???
Expected: UTF-8 encoded JSON with correct Cyrillic
Actual: JSON with ??? replacing non-ASCII characters
Sample hook script:
import sys, json
with open('/tmp/cursor-hook.log', 'a') as f:
data = sys.stdin.read()
f.write(data + '\n')
print('{}')
Operating System
Windows 10/11
Version Information
Cursor IDE Version: 2.4.22
Does this stop you from using Cursor
Yes - Cursor is unusable