Spending tokens to repair UTF-16 that should have been UTF-8

This is a known issue affecting file writes on Windows. The agent’s Write and StrReplace tools use their own encoding detection pipeline that can select the wrong encoding (UTF-16 LE, Windows-1252, or GBK depending on the environment), bypassing the files.encoding setting in .vscode/settings.json. Our team is actively investigating this.

Your workaround suite (Cursor hooks, git validators, PowerShell profile defaults) is impressively thorough and well-documented. For others hitting this, these are solid mitigations until the fix ships.

You may also find this related thread helpful, where other Windows users have reported similar encoding corruption and shared additional context:

Could you share your Cursor version (Menu > About Cursor > Copy)? That would help us confirm whether recent encoding-related fixes are included in your build.