Skip to content Skip to sidebar Skip to footer

Eszett (ß) In Android App (2)

I have a span like this: private SpannableStringBuilder spandex(List ret, Boolean startDark) { SpannableStringBuilder spanBuilder = new SpannableStringBuilder();

Solution 1:

ugh, this fixes it:

private String myUpperCase(String word) {
    word = word.replaceAll("ß", "XXX");
    return word.toUpperCase().replaceAll("XXX", "ß");
}  

so as you probably already know, the issue is that ß gets expanded to SS in java utf-8 toUpperCase() and that increases the length of the string in the span by one, but "x" (in my code above) is one char short (length) so i get the default white text.

i am happy with the fix.


Post a Comment for "Eszett (ß) In Android App (2)"