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

Thanks for bearing with this, and I’m sorry it’s still eating into your time.

Honest status: this is still an open issue we’re tracking, and I don’t have a fix date I can share yet. I’ll post here the moment one ships.

While it’s pending, this is the most reliable setup to stop losing prompts to it:

  1. New files: have the agent create them through the terminal rather than the Write tool. A short rule like “create new script files by writing them via the terminal, not the Write tool” makes it stick.
  2. Post-edit hook scoped to the changed file only (not a repo-wide scan), so anything written as UTF-16 gets re-saved as UTF-8 right after the edit.
  3. To recover a file that’s already corrupted: click the encoding indicator in the bottom-right status bar → Reopen with Encoding → UTF-16 LE (it renders correctly), then click it again → Save with Encoding → UTF-8. The content is fully recoverable, so nothing is lost — commit first if you’re batch-fixing.

If you’re still getting hit every prompt even with new files going through the terminal, reply with your Cursor version and I’ll look into your specific case.