Hey, thanks for the detailed report. This is a known issue: the Agent in 2.4.x forces all files to be saved as UTF-8 and ignores the original encoding.
You’re not alone. There are already 8+ similar threads for Windows-1252, EUC-KR, and GB2312/GBK. The team is aware and the bug is logged.
Workarounds:
-
Manually re-save after every AI edit:
- After the Agent changes the file: bottom-right corner of the editor → click the encoding → “Reopen with Encoding” → Windows-1252
- Then “Save with Encoding” → Windows-1252
- Annoying, but it works
-
Try CTRL+K (inline edit) instead of Agent. It might break encoding less often, but it’s not guaranteed
Related threads:
- Cursor returns UTF-8 code despite Windows-1252 configuration
- Issue with Agent Corrupting Korean Characters (EUC-KR Encoding) during Auto-Edits
- The agent mode may cause encoding issues
I see you tried .cursorrules, .code-workspace, and files.encoding. You’re right, this is an architectural issue in how Agent applies edits. Settings are ignored right now.