Cursor AI edits corrupt Windows-1252 encoding in C++ projects (even when editor shows 1252)

char_battle.zip (20.5 KB) try

delphi7.7z (329 bajtów)

Hello Ani,
I am sending two files: Unit1 - kopia.pas, the original file from the Delphi 7 IDE, and Unit1.pas, which was edited and saved by Cursor, despite my request not to modify any comments, messages, etc.

Regards,
Tomasz

1 Like

Hey all :waving_hand:

I have merged the related topics on encoding into a single thread, so we can keep everything in one place and avoid missing anyone when we share updates.

1 Like

Hey Tomasz, thanks to your file, this should be fixed in the next version of Cursor. If you have explicitly configured a file with a particular encoding (even if that encoding is counter to what the agent would’ve auto-inferred), this encoding should be maintained, so that agent edits should generally match human-written ones.

An important question though, how are you telling Cursor that your file is Windows-1250? Are you doing “Reopen with encoding…” and the status bar says Windows-1250? Or are you using the files.encoding property?

1 Like

I’m experiencing an issue with HTML and PHP files encoded in ISO-8859-1.
Whenever I use agentic features or ‘Ctrl+K’ to refactor code, the special characters across the entire file get corrupted.

I am using the files.encoding setting in the workspace configuration.

In the root of my workspace I have:

.vscode/settings.json

with the following entry:

{
  "files.encoding": "windows1250",
  "files.autoGuessEncoding": false
}

So the encoding is defined at the workspace level, which means it applies to all files in the workspace and its subfolders.

I am not relying on “Reopen with Encoding…” manually for each file. The expectation is that Cursor opens and saves the files using Windows-1250 automatically because of the workspace files.encoding setting.

I’m using version 2.2.44 because of the CP-850 corruption, which is the same issue as WIN1252 that has been discussed in several threads and hasn’t been fixed in the current version. Now I can’t use it anymore because everything I request displays the message “Please update to the latest Cursor version to continue using the Agent.” What should I do? Should I cancel my subscription since I’m paying and can’t use it due to the file corruption problem in the current versions, and they won’t let me use an older version that doesn’t have this problem? @deanrie

I suggest you pay attention to resolving this as soon as possible, because faced with the problem I signed up for Copilot for $10, which, integrated with Claude, I realized I no longer need to use Cursor (which costs $60). I project in Claude and use Copilot to apply the planning, so in short, I ended up saving $50 a month with this problem. However, I paid for Cursor a year in advance, and now what do I do with the credits I won’t be using anymore?