Where does the bug appear (feature/product)?
Cursor IDE
Describe the Bug
When using the Agent to create new code files, everything looks correct in the chat output (Chinese characters display normally). However, after the file is written to the workspace, the actual file content becomes garbled.
Steps to Reproduce
My workspace is configured to use UTF-8 encoding.
Use the Agent to create new code files(including chinese).
The newly generated file will contain unreadable characters.
To read the file correctly, I have to open it using GBK encoding and then manually re-save it as UTF-8.
It seems that the Agent is writing files using GBK encoding instead of UTF-8, despite the workspace being configured for UTF-8.
Expected Behavior
The Agent should always write files using UTF-8 encoding, consistent with the workspace encoding. Chinese characters should be correctly preserved without requiring manual re-encoding.
Screenshots / Screen Recordings
Operating System
Windows 10/11
Version Information
Version: 3.1.14 (user setup)
VSCode Version: 1.105.1
Commit: d8673fb56ba50fda33ad78382000b519bb8acb70
Date: 2026-04-14T01:39:23.679Z
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
OS: Windows_NT x64 10.0.26200
For AI issues: which model did you use?
Composer2 gpt-5.4 Codex-5.3
For AI issues: add Request ID with privacy disabled
3e6bae18-8b10-4626-b5fc-e0135ae057ce
Does this stop you from using Cursor
No - Cursor works, but with this issue
