2021-07-28 07:48 AM
Hi,
I added wildcard characters (ç,Ç,ğ,Ğ,ı,İ,ö,Ö,ş,Ş,ü,Ü) to TouchGFX , if I set text in there it can show these characters correctly.
When I set text in code like this:buffer gets filled with wrong numbers and it shows all question mark. Normally "ŞŞşş ÇÇçç" must be 5353737320c7c7e7e7 but its like that: and when I convert it to string its "ŞŞşş Ç". How can I solve this problem? Thank you.
2021-07-28 07:58 AM
2021-07-29 11:45 PM
Ok its my bad I didn't know about that.
Percent encoding fits my data. So CubeIDE converting correctly but it cant show correct letters.
This is when I set text in TouchGFX, it can show correctly.
This is when I set text with the code below.
Unicode::snprintf(textNotBuffer,TEXTNOT_SIZE,"ŞŞşş ÇÇçç");
textNot.invalidate();
What should I do to solve this? Thank you.
2021-07-30 12:04 AM
2021-07-30 07:13 AM
I found the problem but I still dont know solution.
Here you can see there are different kind of converting styles like UTF-8, UTF-16, UTF-32. STM32CubeIDE is converting to UTF-8.
Then I added this range to see data.
And I saw same text in the top picture. Fallback character is rectangle in there and question mark for my case.
Finally I tried UTF-16 data like this.
I get what I want. So I need to convert string to UTF-16 format instead of UTF-8. How can I do this?
2021-07-30 07:28 AM
Then I added this range to see data.
This dont help you. For special chars you need place every one to list , that on your image is empty now. Wildcard Characters:
2021-07-30 07:57 AM
I tried it so many times in "ç", "Ç", "ğ", "Ğ" ... or çÇğĞıİ... formats. It didn't work. I tried again just now and didn't work again.
As you see char is 16 bits here and it is converting to 8 bits. If I delete 0x000-0xfff from wildcard ranges it cant even show "Å?Å?Å?Å? Ã?Ã?çç", it becomes all question marks(??????). Actually it would still work but when I write 'Ş' to wildcard characters it accepts it like 0x015e I believe but in the code when I use 'Ş' in string compiler is converting it to 0xc5,0x9e . If I convert 0x00c5, 0x009e as UTF-16 I am getting this which is what I get in screen instead of 'Ş'.
2021-08-04 11:07 PM
Isn't is the bug of STM32CubeIDE ? Unicode is using UTF16 but STM32CubeIDE is converting it to UTF8.