Where does the bug appear (feature/product)?
Cursor IDE
Describe the Bug
Hello Cursor team,
I’m reporting a reproducible encoding corruption issue affecting C++ projects that use Windows-1252 (ANSI).
Environment
Cursor 2.4.27 (Stable)
VSCode 1.105.1
OS: Windows 10 x64
Project type: C++ (legacy codebase)
File encoding: Windows-1252
Line endings: CRLF
Project constraints
This is a legacy C++ project that must remain in Windows-1252 for compatibility reasons (toolchain, resource files, existing assets). Migrating to UTF-8 is not currently an option.
Configuration already applied
files.encoding = windows1252
files.autoGuessEncoding = false
EditorConfig with charset = windows-1252
.gitattributes with * text=auto
No format-on-save, no code actions on save
The problem
If I manually edit and save the file → no corruption
If I ask Cursor AI to do a minimal change (e.g. remove a single line) and apply it:
The entire file content gets corrupted
Accented characters (ç, ã, é, etc.) turn into ç, ã, é, etc.
Status bar still shows “Windows-1252”, even though the bytes were clearly rewritten incorrectly
This strongly suggests that the AI apply / patch mechanism rewrites the file as UTF-8 internally, ignoring the original encoding, while the UI continues to report Windows-1252.
Key observation
The corruption does not happen on open or manual save — it happens only when Cursor AI applies changes.
Expected behavior
When applying AI edits:
Preserve the original file encoding
Or at least detect non-UTF-8 encodings and avoid rewriting the full file
Impact
This makes Cursor unsafe to use on C++ legacy projects with non-UTF-8 encodings, as a single AI edit can silently corrupt the entire file.
Request
Is this a known issue?
Is there a setting or flag to force AI edits to respect the file’s original encoding?
If not, please consider this a bug report, as it breaks real-world C++ legacy codebases.
I’m happy to provide a minimal repro if needed.
Thanks.
Steps to Reproduce
Cursor 2.4.27 (Stable)
VSCode 1.105.1
OS: Windows 10 x64
Project type: C++ (legacy codebase)
File encoding: Windows-1252
Line endings: CRLF
Expected Behavior
…
Operating System
Windows 10/11
Version Information
Cursor 2.4.27 (Stable)
VSCode 1.105.1
OS: Windows 10 x64
Project type: C++ (legacy codebase)
File encoding: Windows-1252
Line endings: CRLF
Does this stop you from using Cursor
Yes - Cursor is unusable