Where does the bug appear (feature/product)?
Cursor IDE
Describe the Bug
In Cursor’s chat interface, the preview code displays Korean and Chinese characters correctly. However, when Cursor inserts the modified code into the actual file, it causes all Korean and Chinese characters in the entire file to become garbled. My project uses GBK encoding, and I have also set the Cursor IDE’s file encoding to GBK. I added a .vscode/settings.json file and even uninstalled all extensions, but the issue persists. Still no luck.
Steps to Reproduce
I created a Java project using GBK encoding and added comments in both Korean and Chinese to the code. Then, while chatting with Cursor, I asked it to help add code comments. After that, the issue I mentioned earlier occurred: the comment text displays correctly in the chat dialog, but once Cursor inserts the comments and code into the actual code file, all Korean and Chinese characters in the entire file become garbled.
Expected Behavior
It was supposed to use GBK encoding to modify and save the file, but it seems to have used another format—such as UTF-8, Windows-1255, or something else. I’m not entirely sure, because after applying the changes to the code file, everything just turned into question marks and random garbled characters.
Operating System
Windows 10/11
Version Information
Version: 2.4.21 (user setup)
VSCode Version: 1.105.1
Commit: dc8361355d709f306d5159635a677a571b277bc0
Date: 2026-01-22T16:57:59.675Z
Build Type: Stable
Release Track: Default
Electron: 39.2.7
Chromium: 142.0.7444.235
Node.js: 22.21.1
V8: 14.2.231.21-electron.0
OS: Windows_NT x64 10.0.19045
For AI issues: which model did you use?
Composer 1、Opus 4.5 、Sonnet 4.5 、GPT-5.2 Codex
For AI issues: add Request ID with privacy disabled
95c496de-ea41-4632-94cd-8e09b7c3b0f7
Does this stop you from using Cursor
No - Cursor works, but with this issue