![]()
![]()
![]()
![]()
Hey there,
This is a known issue on our side, not anything wrong with your setup. When the agent edits a file, its write path can pick the wrong text encoding, and when that encoding can’t represent Chinese characters it swaps them for ?. The wrong encoding then gets “stuck” to that file, so the same thing happens on every later edit, which is why it keeps coming back in the same file. It’s something our team is tracking, though I don’t have a fix timeline to share yet.
Once characters have turned into a literal ?, they can’t be recovered from the file itself (the original characters are already gone). But the correct Chinese is still recoverable from before the edit:
git checkout -- <file>). Back up any other unsaved changes in that file first, since restoring overwrites the current version.Reducing it going forward (most relevant on Windows, which the ? pattern points to):
files.encoding setting on its own doesn’t reliably help here, because the agent’s write path uses its own encoding handling.To point you at the right fix, could you share your OS and exact Cursor version (Help > About Cursor > Copy)? If edits to existing files keep corrupting even with the UTF-8 locale enabled, that’s a newer variant we’re actively looking into, and a sample of a corrupted file would help.