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

**URL:** <https://forum.cursor.com/t/cursor-ai-edits-corrupt-windows-1252-encoding-in-c-projects-even-when-editor-shows-1252/150701>\
**Category:** Bug Reports\
**Tags:** inline-edit, windows, c-cpp, review\
**Created:** [February 3, 2026, 12:19pm UTC](https://forum.cursor.com/t/cursor-ai-edits-corrupt-windows-1252-encoding-in-c-projects-even-when-editor-shows-1252/150701 "2026-02-03T12:19:47Z")\
**Posts on this page:** 1\
**Showing post:** 43

<div class="post-metadata">

**Author:** ![deanrie](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/deanrie/32/1263_2.png) [@deanrie](https://forum.cursor.com/u/deanrie)\
**Post date:** [February 11, 2026, 6:16am UTC](https://forum.cursor.com/t/cursor-ai-edits-corrupt-windows-1252-encoding-in-c-projects-even-when-editor-shows-1252/150701/43 "2026-02-11T06:16:55Z")

</div>

Hey, thanks for the report. This is a known issue, and the same problem was already reported here: [Bug: StrReplace tool strips UTF-8 BOM from files](https://forum.cursor.com/t/bug-strreplace-tool-strips-utf-8-bom-from-files/150794).

A fix that keeps the file encoding is expected in a future release.

For now, the best option is to use the existing PowerShell workaround. Cursor rules won’t reliably help here because the BOM is removed when the file is written, not by the model output.

I’ll update this thread when the fix is released.

---

_[View the full topic](https://forum.cursor.com/t/cursor-ai-edits-corrupt-windows-1252-encoding-in-c-projects-even-when-editor-shows-1252/150701)._
