Japanese Characters Occasionally Corrupted When Using "Apply" Button

I’ve encountered an issue when using the “Apply” button to display code change predictions. Occasionally, instead of showing the expected changes, the prediction incorrectly modifies unrelated parts of the code. Specifically, it sometimes converts portions of Japanese string literals into “��” characters.

This bug appears to be intermittent and doesn’t always occur. However, when it does happen, it affects areas of the code that should not be modified at all, rather than the sections where changes are expected.

Steps to reproduce:

  1. Open a file containing Japanese string literals in Cursor.
  2. Use AI chat or composer.
  3. Click the “Apply” button to generate change predictions.
  4. Observe that sometimes, instead of showing relevant changes, parts of Japanese strings are corrupted into “��” characters in unrelated areas of the code.

Expected behavior: The “Apply” button should only show predictions for relevant code changes and should not modify or corrupt existing Japanese string literals.

Actual behavior: Occasionally, clicking “Apply” results in corrupted Japanese characters (��) in unrelated parts of the code.

Additional information:

  • This issue occurs intermittently and is not consistently reproducible.
  • It only affects Japanese string literals, not other parts of the code.

CleanShot 2024-08-21 at 15.05.17

1 Like

I also have a similar issue with apostrophes, it’s replacing type of apostrophe with a single quote when I hit ‘apply’, despite me not asking to edit that part of the code.

2 Likes