您尚未登录。

楼主 #1 2020-08-07 15:31:27

明月照我沟渠
会员
注册时间: 2020-07-09
已发帖子: 120
积分: 114

分享 littlevgl 检测 编辑器/编译器 是否支持utf-8编码的小技巧

代码: https://github.com/lvgl/lvgl/blob/master/src/lv_core/lv_obj.c

    /*Test if the IDE has UTF-8 encoding*/
    char * txt = "Á";

    uint8_t * txt_u8 = (uint8_t *) txt;
    if(txt_u8[0] != 0xc3 || txt_u8[1] != 0x81 || txt_u8[2] != 0x00) {
        LV_LOG_WARN("The strings has no UTF-8 encoding. Some characters won't be displayed.")
    }

离线

页脚

工信部备案:粤ICP备20025096号 Powered by FluxBB

感谢为中文互联网持续输出优质内容的各位老铁们。 QQ: 516333132, 微信(wechat): whycan_cn (哇酷网/挖坑网/填坑网) service@whycan.cn