cancel
Showing results for 
Search instead for 
Did you mean: 

How to display UTF-8 text in a TextArea Wildcard in TouchGFX?

HTD
Senior III

I set the character wildcards properly, to include all required characters.

Here's my example code:

Unicode::strncpy(errorTextBuffer, "Zażółć gęślą jaźń.", ERRORTEXT_SIZE);
errorText.resizeToCurrentText();
errorText.invalidate();

But what I get is this:

0693W00000NrbceQAB.pngThe character encoding for my entire project is "UTF-8", so this is the file encoding.

I tried to use UART as the debug console and it outputs the UTF-8 text with no problems.

I guess Unicode functions of TouchGFX don't expect the char* strings to be UTF-8. How it is done properly?

1 ACCEPTED SOLUTION

Accepted Solutions
HTD
Senior III

Oh, silly me:

Unicode::fromUTF8((const uint8_t*)"Zażółć gęślą jaźń", errorTextBuffer, ERRORTEXT_SIZE);
errorText.resizeToCurrentText();
errorText.invalidate();

View solution in original post

1 REPLY 1
HTD
Senior III

Oh, silly me:

Unicode::fromUTF8((const uint8_t*)"Zażółć gęślą jaźń", errorTextBuffer, ERRORTEXT_SIZE);
errorText.resizeToCurrentText();
errorText.invalidate();