/* Convert a wide character, e.g. 'Á' little endian to be UTF-8 compatible  */
static uint32_t lv_txt_utf8_conv_wc(uint32_t c)
/* Convert a wide character, e.g. 'Á' little endian to be UTF-8 compatible  */
static uint32_t lv_txt_utf8_conv_wc(uint32_t c)
{
    if((c & 0x80) != 0) {
        uint32_t swapped;
        uint8_t c8[4];
        memcpy(c8, &c, 4);
        swapped = (c8[0] << 24) + (c8[1] << 16) + (c8[2] << 8) + (c8[3]);
        uint8_t i;
        for(i = 0; i < 4; i++) {
            if((swapped & 0xFF) == 0)
                swapped = (swapped >> 8);
        }
        c = swapped;
    }
    return c;
}