Diacritics/international characters in AutoCompleteTextView

前端 未结 8 1902
耶瑟儿~
耶瑟儿~ 2021-02-15 17:02

I have a (array) list

Car
Something
Šibica
Čavao
Cavao

Is there a way to \"force\" AutoCompleteTextView so if user type in letter \"c\"

8条回答
  •  孤独总比滥情好
    2021-02-15 17:29

    To make people's lives easier, here's what you need to add to the correct answer by @svenkapudija for French accented character compatibility. This was made via excel in less than 40 seconds

    original = original.replace("À ", "A");
    original = original.replace("à ", "a");
    original = original.replace(" ", "A");
    original = original.replace("â ", "a");
    original = original.replace("Æ", "AE");
    original = original.replace("æ", "ae");
    original = original.replace("Ç", "C");
    original = original.replace("ç", "c");
    original = original.replace("È ", "E");
    original = original.replace("è", "e");
    original = original.replace("É ", "E");
    original = original.replace("é", "e");
    original = original.replace("Ê ", "E");
    original = original.replace("ê ", "e");
    original = original.replace("Ë ", "E");
    original = original.replace("ë ", "e");
    original = original.replace("Π", "I");
    original = original.replace("î ", "i");
    original = original.replace("Ï ", "I");
    original = original.replace("ï ", "i");
    original = original.replace("Ô", "O");
    original = original.replace("ô", "o");
    original = original.replace("Œ", "OE");
    original = original.replace("œ", "oe");
    original = original.replace("Ù", "U");
    original = original.replace("ù", "u");
    original = original.replace("Û", "U");
    original = original.replace("û", "u");
    original = original.replace("Ü", "U");
    original = original.replace("ü", "u");
    

提交回复
热议问题