yuan860606
(Yuan860606)
January 29, 2026, 6:07am
1
Where does the bug appear (feature/product)?
Cursor IDE
Describe the Bug
The AI assistant’s file editing tool (search_replace) cannot preserve the original encoding (GBK/GB2312) when editing files, causing Chinese characters to become garbled.
Steps to Reproduce
Open a JSP file with GBK encoding (file header declares charset=GBK)
Use AI assistant to perform text replacement operations
All Chinese characters in the file become garbled (displayed as ???)
Even with .vscode/settings.json configured for GBK encoding, the issue persists
Operating System
Windows 10/11
Version Information
Cursor 2.4.22
Additional Information
Reverting to Cursor 2.3.41 is normal
Does this stop you from using Cursor
No - Cursor works, but with this issue
deanrie
(Dean Rie)
January 30, 2026, 4:46am
3
Hey, thanks for the report. This is a known issue: Agent in 2.4.x forces all files to be saved as UTF-8, ignoring the original encoding.
Similar reports with GBK, EUC-KR, Windows-1252:
Workarounds:
Roll back to 2.3.41. A few users confirmed this fully fixes the issue.
After Agent edits: bottom-right corner of the editor → click the encoding → “Reopen with Encoding” → GBK, then “Save with Encoding” → GBK.
Try CTRL+K (inline edit) instead of Agent/Chat. It might break encoding less, but it’s not guaranteed.
The team is aware of the issue. Your report helps raise the priority, especially for GBK/GB2312, which are critical for Chinese legacy projects.
Manuel_C.C
(Manuel C.C.)
January 30, 2026, 11:32am
4
But the question is when it will be solved?
This is a first class BUG!!!
2 Likes
please fix this bug, fast.
Manuel_C.C
(Manuel C.C.)
February 25, 2026, 4:04pm
7
2 months later … the bug is unfixed …
1 Like
Manuel_C.C
(Manuel C.C.)
February 25, 2026, 4:05pm
9
Now, I have lost 1 hour becouse cursor ide has edited a file full of accents and has removed all …
I do not say what it is …
system
(system)
Closed
March 19, 2026, 4:05pm
10
This topic was automatically closed 22 days after the last reply. New replies are no longer allowed.