1. why have both of these variables, you could use
Code: Select all
$UTF8_LOWER_TO_UPPER = array_flip($UTF8_UPPER_TO_LOWER);
Code: Select all
$UTF8_LOWER_TO_UPPER = array_flip($UTF8_UPPER_TO_LOWER);
Eelke wrote: Well, I'm assuming these are arrays with UTF8 uppercase characters as the keys and the associated UTF8 lowercase characters as the values.
However, I can imagine that to convert ö to uppercase, you actually want to use O, not O with an umlaut on top (in some languages, that's actually considered bad form). I.e., the lower case to upper case table would contain many lower case characters (ö, õ, ô, ó) mapping to the same upper case character (O). Simply reversing that mapping (which is what is being suggested, if I understand correctly) would not get you the correct result.