After the file is written to the workspace, the actual file content becomes garbled

Hey, thanks for the report. This is a known encoding issue on Chinese Windows. Agent Write and StrReplace create files in GBK instead of UTF-8.

Root cause: the auto-detect encoding logic picks up GBK from the system environment or existing files and then propagates it to new files, even if the workspace is set to UTF-8.

Temporary workaround while it gets fixed:

  • Reopen the file explicitly with GBK encoding: File > Reopen with Encoding > GBK
  • Use Save As and pick UTF-8 encoding

Related reports:

The bug is logged, and your report helps raise the priority. Let me know if you notice any patterns for when it happens or does not happen. That would help the team.