Skip to main content
Associate
February 2, 2024
Solved

Unexpected wildcard characters displayed for specific Japanese characters

  • February 2, 2024
  • 1 reply
  • 1125 views

Hello,

I'm getting the wildcard character '?' displayed for 3x Japanese characters, ノ今速.  All the other CJK characters in the texts are displayed fine, before and after these missing characters (so not a text field truncation).

I've checked that all these characters exist in the CJK font for the typography.  I have defined the respective Unicode values 0x30CE, 0x4ECA, 0x901F in the wildcard ranges and pasted these characters into the wildcard characters for the typography.  I have deleted and regenerated the generated folder, but there is no difference in the output. There are also no warnings during code generation that a character is not in the font.

The text translations specifying these characters are all defined as resources (not single use texts).  They are displayed using 
touchgfx::Unicode::UnicodeChar TXTBuffer[TXT_SIZE];
(void)Unicode::snprintf(TXTBuffer, TXT_SIZE, "%s", touchgfx::TypedText(T_RESOURCE_NAME.getText());

I've found they are displayed correctly using 

Unicode::fromUTF8((const uint8_t*)"ノ今速", TXTBuffer, TXT_SIZE);

Why is this different?  I'm still using TouchGFX 4.16.0. 

Thanks.

This topic has been closed for replies.
Best answer by moredatalesscenter1

I found and fixed the problem I was having - the text that snprintf was writing to was a different typography to the one defined in the resource.  Adding the wildcard range to that typography instead of the one for the resource fixed it.

1 reply

moredatalesscenter1AuthorBest answer
Associate
February 3, 2024

I found and fixed the problem I was having - the text that snprintf was writing to was a different typography to the one defined in the resource.  Adding the wildcard range to that typography instead of the one for the resource fixed it.