Where does the bug appear (feature/product)?
Cursor IDE
Describe the Bug
On Windows, when Cursor Agent edits files via StrReplace or Write, the file is sometimes saved as UTF-16 LE (no BOM) instead of UTF-8. Every ASCII character is followed by a null byte (U+0000), which corrupts the entire file.
This is not a project configuration issue — it is blocking daily development and significantly slowing down work.
Impact on my workflow (severity: critical)
- Work speed is extremely slow because almost every Agent edit risks corrupting the file.
- Errors occur repeatedly after Agent changes (not from my code logic).
- I have to manually fix source files every time this happens.
- I created a separate Python scan script (
check_utf8_sources.py) and run it after every Agent session to find corrupted files. - When UTF-16 corruption occurs, my entire dev environment stops working:
- Flutter —
control character U+0000, compilerRangeError (index), build/hot reload fails - Java/backend server —
illegal character '\u0000', compilation fails - Nothing runs until the file is recovered to UTF-8
This is a productivity and reliability blocker, not a minor encoding annoyance.
- Flutter —
Steps to Reproduce
- Open a normal UTF-8 Dart file (BOM 없음,
import로 시작, hex69 6D 70= “imp”) - Ask Cursor Agent to modify the file using StrReplace (or Write)
- Agent completes; file appears edited in the editor
- On disk, file is UTF-16 LE:
- File size roughly doubles
- Null bytes between characters: hex
69 00 6D 00 70 00instead of69 6D 70
- Run
flutter run/dart analyze/ Java compile → fails immediately
Expected Behavior
All Agent file writes (StrReplace, Write) must save as UTF-8 without BOM, regardless of file size, language (Korean), or OS.
Operating System
Windows 10/11
Version Information
CURSOR IDE
For AI issues: which model did you use?
AUTO
Does this stop you from using Cursor
No - Cursor works, but with this issue