How to use wchar_t in lvgl text objects


Hello I was wondering if someone knows how to use wchar_t type when creating lv_label?

What MCU/Processor/Board and compiler are you using?

Currently, simulator. We are still developing on windows.

What LVGL version are you using?


What do you want to achieve?

To be able to print out unicode UTF+8 characters. Suggestion says to use wchar_t but I don’t if it can be used together with LVGL texts.

What have you tried so far?

See code below

Code to reproduce

Add a code snippet which can run in the simulator. It should contain only the relevant code that compiles without errors when separated from your main code base.

The code block(s) should be formatted like:

    setlocale(LC_CTYPE, "");
    wchar_t sample = 0x306F;
    wprintf(L"%c\n", sample);

    . . .
   lv_label_set_text(obj, (char *) sample);

Screenshot and/or video

If possible, add screenshots and/or videos about the current state.