It’s about the Chinese garbled text issue in the source code generated by the Cursor editor, can you take a look and fix it?

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.

Hi there!

We detected that this may be a bug report, so we’ve moved your post to the Bug Reports category.

To help us investigate and fix this faster, could you edit your original post to include the details from the template below?

Bug Report Template - Click to expand

Where does the bug appear (feature/product)?

  • Cursor IDE
  • Cursor CLI
  • Background Agent (GitHub, Slack, Web, Linear)
  • BugBot
  • Somewhere else…

Describe the Bug
A clear and concise description of what the bug is.


Steps to Reproduce
How can you reproduce this bug? We have a much better chance at fixing issues if we can reproduce them!


Expected Behavior
What is meant to happen here that isn’t working correctly?


Screenshots / Screen Recordings
If applicable, attach images or videos (.jpg, .png, .gif, .mp4, .mov)


Operating System

  • Windows 10/11
  • MacOS
  • Linux

Version Information

  • For Cursor IDE: Menu → About Cursor → Copy
  • For Cursor CLI: Run agent about in your terminal
IDE:
Version: 2.xx.x
VSCode Version: 1.105.1
Commit: ......

CLI:
CLI Version 2026.01.17-d239e66

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!

Hi,

Thanks for posting on the Cursor forum!

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.

cursor encoding bug report

product:cursor ide

Describe:Cursor agent mode,The Agent written files default GBK,But I hope Utf-8,and try much way to config,This problem always appear

Steps:Let agent do something,for example,Agent create a new File, must appear the GBK encoding bug

Expected Behavior:default utf-8 encoding

Operating System : Windows 10
**Version Information:**Version: 3.7.19 (user setup)
VS Code Extension API: 1.105.1
Commit: 80c653c2c3528e65016a0d304b54486084b470b0
Date: 2026-06-07T01:42:56.126Z
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.256
OS: Windows_NT x64 10.0.19045

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:

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.