/* Convert a character index (in an UTF-8 text) to byte index. E.g. in "AÁRT" index of 'R' is 2th char but start at byte 3 because 'Á' is 2 bytes long  */
static uint32_t lv_txt_utf8_get_byte_id(const char *txt, uint32_t utf8_id)
/* Convert a character index (in an UTF-8 text) to byte index. E.g. in "AÁRT" index of 'R' is 2th char but start at byte 3 because 'Á' is 2 bytes long  */
static uint32_t lv_txt_utf8_get_byte_id(const char *txt, uint32_t utf8_id)
{
    uint32_t i;
    uint32_t byte_cnt = 0;
    for(i = 0; i < utf8_id && txt[byte_cnt] != '\0'; i++) {
        uint8_t c_size = _lv_txt_encoded_size(&txt[byte_cnt]);
        byte_cnt += c_size ? c_size : 1;
    }
    return byte_cnt;
}