Key takeaway: it has nothing to do with the file extension. Earlier cursorAgentEditExtractor.ts was UTF-8 only because it was later rewritten by StrReplace and went through a different write path. The real reason is that when the Cursor agent creates new files, its write path uses GBK/CP936 encoding for the zh-CN locale and ignores all files.encoding settings. This is Cursor-side behavior and there’s no config switch to change it. So trying to fix it via settings just won’t work.
That’s the conclusion from Cursor opus4.8. It’s been going on for months and still hasn’t been solved.
For AI issues: which model did you use?
Model name (e.g., Sonnet 4, Tab…)
For AI issues: add Request ID with privacy disabled
Request ID: f9a7046a-279b-47e5-ab48-6e8dc12daba1
For Background Agent issues, also post the ID: bc-…
Additional Information
Add any other context about the problem here.
Does this stop you from using Cursor?
Yes - Cursor is unusable
Sometimes - I can sometimes use Cursor
No - Cursor works, but with this issue
The more details you provide, the easier it is for us to reproduce and fix the issue. Thanks!
To help ensure most of our users can participate in discussions, this forum is currently English only.
If you’d like, you can edit your post to translate it into English. Once it meets our guidelines, it will be automatically relisted.
Thanks for understanding!
Note: This is an automated detection system and sometimes makes mistakes. If your post is already in English, feel free to ignore this message, or just make a small edit and it will be reviewed again.
Hey, this is a known issue: on systems with the zh-CN locale and the GBK 936 code page, the agent write and StrReplace tools write files in a non-UTF-8 encoding, so Chinese characters turn into mojibake. We’ve logged the bug, but I can’t share an ETA for a fix yet.
A few important notes:
Based on reports from other users, switching the system code page to UTF-8 65001 via Beta: Use Unicode UTF-8 for worldwide language support doesn’t fix it reliably, so I won’t suggest that as a workaround.
If there’s an update on the fix, I’ll reply in the thread. Also, if you can, please add your Cursor version via Menu → About Cursor → Copy. It’ll help link your case to the others.