cancel
Showing results for 
Search instead for 
Did you mean: 

STM32CubeIDE can't convert TouchGFX wildcard characters correctly

kb24
Senior

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:0693W00000D0tPcQAJ.jpgbuffer gets filled with wrong numbers and it shows all question mark. Normally "ŞŞşş ÇÇçç" must be 5353737320c7c7e7e7 but its like that:0693W00000D0tSbQAJ.jpg and when I convert it to string its "ŞŞşş Ç". How can I solve this problem? Thank you.

7 REPLIES 7
MM..1
Chief II

Ok its my bad I didn't know about that.

0693W00000D142AQAR.jpg 

Percent encoding fits my data. So CubeIDE converting correctly but it cant show correct letters.

0693W00000D143cQAB.jpgThis is when I set text in TouchGFX, it can show correctly.

0693W00000D144BQAR.jpgThis 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.

I found the problem but I still dont know solution.

0693W00000D17KhQAJ.jpgHere you can see there are different kind of converting styles like UTF-8, UTF-16, UTF-32. STM32CubeIDE is converting to UTF-8.

0693W00000D17OnQAJ.jpgThen I added this range to see data.

0693W00000D17UqQAJ.jpgAnd I saw same text in the top picture. Fallback character is rectangle in there and question mark for my case.

0693W00000D17X6QAJ.jpgFinally I tried UTF-16 data like this.

0693W00000D17aBQAR.jpgI get what I want. So I need to convert string to UTF-16 format instead of UTF-8. How can I do this?

0693W00000D17OnQAJ.jpgThen 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:

0693W00000D17m6QAB.jpgI tried it so many times in "ç", "Ç", "ğ", "Ğ" ... or çÇğĞıİ... formats. It didn't work. I tried again just now and didn't work again.

0693W00000D17peQAB.jpgAs 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 this0693W00000D17yvQAB.jpg which is what I get in screen instead of 'Ş'.

kb24
Senior

Isn't is the bug of STM32CubeIDE ? Unicode is using UTF16 but STM32CubeIDE is converting it to UTF8.