Hi! When I input ą or ę, or ó and then I want to remove it with a simple click, it renders A with a hat on. Also ł and ś renders l with a point and then when I click backspace again, it deletes this letter.
How to fix it?
Can I somehow easly remove special letters, to not accidentally render it (would be better if those letters would be available, but if this bug is hard to fix, better remove them) ?
I think your problem is that you are trying to handle an utf8 string as an ascii string.
If you encode your data with UTF-8, some letters might use more than one byte. Your special characters (ś, ą, …) use this. So removing one byte at the end of the string might actually break the letters. Id recommend reading up on encodings, especially UTF-8. As a starting point, just good old wikipedia https://en.wikipedia.org/wiki/UTF-8
As a quick solution, i think what you can do is check (when executing the removal) if the current last byte looks like this: “0b10xxxxxx”, where x can be anything. If it does not, just remove the last byte. If it does look like that, you need to remove all bytes up until and you find one where it looks like this. “0b11xxxxxx”.
Im not sure what functionality SDL provides for handling UTF-8 to be honest.