Description
It is display incorrect character When I use obj_label display chinese “海纳百川” with utf8 in V7.It become “海纳*川”
What MCU/Processor/Board and compiler are you using?
Linux develop board - imx6
What LVGL version are you using?
V7.2.0
What do you want to achieve?
display correct character
What have you tried so far?
remake font lib and display other chinese character “天气时钟”,But result is incorrect too
Code to reproduce
In officer’s demo lv_demo_printf, I modify part program.
static void info_bottom_create(const char * dsc, const char * btn_txt, lv_event_cb_t btn_event_cb, uint32_t delay)
{
lv_obj_t * txt = lv_label_create(lv_scr_act(), NULL);
lv_label_set_text(txt, dsc);
lv_theme_apply(txt, (lv_theme_style_t)LV_DEMO_PRINTER_THEME_LABEL_WHITE);
lv_obj_add_style(txt, LV_OBJ_PART_MAIN, &style_chinese);
lv_obj_align(txt, NULL, LV_ALIGN_CENTER, 0, 100);
lv_obj_t * btn = lv_btn_create(lv_scr_act(), NULL);
lv_theme_apply(btn, (lv_theme_style_t)LV_DEMO_PRINTER_THEME_BTN_BORDER);
lv_obj_set_size(btn, LV_DEMO_PRINTER_BTN_W, LV_DEMO_PRINTER_BTN_H);
lv_obj_align(btn, txt, LV_ALIGN_OUT_BOTTOM_MID, 0, 60);
lv_obj_set_style_local_value_str(btn, LV_BTN_PART_MAIN, LV_STATE_DEFAULT, btn_txt);
lv_obj_set_event_cb(btn, btn_event_cb);
lv_demo_printer_anim_in(txt, delay);
delay += LV_DEMO_PRINTER_ANIM_DELAY;
lv_demo_printer_anim_in(btn, delay);
delay += LV_DEMO_PRINTER_ANIM_DELAY;
lv_demo_printer_anim_in(btn, delay);
}
LV_EVENT_CB_DECLARE(setup_icon_event_cb)
{
#if 1
if (e == LV_EVENT_CLICKED) {
lv_demo_printer_anim_out_all(lv_scr_act(), 0);
lv_demo_printer_anim_bg(0, LV_DEMO_PRINTER_RED, LV_DEMO_PRINTER_BG_FULL);
uint32_t delay = 200;
lv_style_init(&style_chinese);
lv_style_set_bg_opa(&style_chinese, LV_STATE_DEFAULT, LV_OPA_COVER);
lv_style_set_bg_color(&style_chinese, LV_STATE_DEFAULT, LV_DEMO_PRINTER_RED);
lv_style_set_text_font(&style_chinese, LV_STATE_DEFAULT, &myFontYH12);
info_bottom_create("海纳百川", "BACK", back_to_home_event_cb, delay);
}
#endif
icon_generic_event_cb(obj, e);
}