cancel
Showing results for 
Search instead for 
Did you mean: 

touchGFX and snprintf function

Professional
Senior

Hello,

i use snprintf function to print some UnicodeChar variable. But i have trouble to get special charcters printed (as é, è, ü...) by the mean of this function.

(even if i have declared in the typography wildcard Character column the special characters (éè) )

What is the right way to have these specials characters printed ?

Thanks

best regards   

exemple :

touchgfx::Unicode::UnicodeChar start_txt_next_service_valueBuffer[START_TXT_NEXT_SERVICE_VALUE_SIZE];

 Unicode::snprintf(start_txt_next_service_valueBuffer, START_TXT_NEXT_SERVICE_VALUE_SIZE, "%d %s", CAN_getNextServiceDays(), TypedText(T_START_NEXT_SERVICE_DAYS).getText());

11 REPLIES 11
Professional
Senior

So don't know where the problem is : the containt of the start_txt_next_service_valueBuffer is correct:

Here is the declartion of variables :

touchgfx::TextAreaWithOneWildcard start_txt_next_service_value;

   

   /*

    * Wildcard Buffers

    */

   static const uint16_t START_TXT_NEXT_SERVICE_VALUE_SIZE = 50;

   touchgfx::Unicode::UnicodeChar start_txt_next_service_valueBuffer[START_TXT_NEXT_SERVICE_VALUE_SIZE];

thanks for your support

Professional
Senior

Hello,

When i do not use the UnicodeChar variable start_txt_next_service_valueBuffer) link to tart_txt_next_service_value, that works OK :

  start_txt_next_service_value.setTypedText(TypedText(T_START_SERVICE_LINE2_NUM14)); prints well é or è special characters.

So th eproblem is not in the font generation, but in the fact we use a  touchgfx::Unicode::UnicodeChar buffer linked to a touchgfx::TextAreaWithOneWildcard variable.

Is there a way to print correctly special characters ?

Thanks

best regards