You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ImGuiInputTextCallbackData#insertChars works fine when inserting ASCII characters, but inserts wrong characters when trying to add anything else.
Reproduction
When setting the buffer returned by an InputText callback like so:
StringnewText = "new text";
data.setBufDirty(true);
data.deleteChars(0, data.getBuf().length());
data.insertChars(0, newText);
It works perfectly when using only ASCII characters. However, if you use UTF-8 characters (for example, Cyrillic), the buffer is also fed with some incorrect bytes.
For example, here's how the buffer looks before writing in Russian:
"hello"
And here's how it looks after typing "я":
"helloя�"
If you continue typing, the application will crash entirely with an assertion failure.
Version
1.86.11
What happened?
ImGuiInputTextCallbackData#insertChars works fine when inserting ASCII characters, but inserts wrong characters when trying to add anything else.
Reproduction
When setting the buffer returned by an InputText callback like so:
It works perfectly when using only ASCII characters. However, if you use UTF-8 characters (for example, Cyrillic), the buffer is also fed with some incorrect bytes.
For example, here's how the buffer looks before writing in Russian:
And here's how it looks after typing "я":
If you continue typing, the application will crash entirely with an assertion failure.
Relevant log output
The text was updated successfully, but these errors were encountered: