(no title)
korlja | 3 years ago
Blindly calling .ToUpper() on anything is a typical anglo-centric mistake. Just don't use .ToUpper(), shoutcase is ugly anyways ;)
See also: one of the many "100 fallacies programmers assume about natural written language" documents or such.
AdrianoKF|3 years ago
usr1106|3 years ago
korlja|3 years ago
egeozcan|3 years ago
As long as there is no unicode SS character, we are into the "what color are your bits" problem or tolower needs to be language and word aware.
In .NET the uppercase and lowercase functions are culture aware (with defaults to system settings, which breaks more software than you might think) but not word aware AFAIK.
bee_rider|3 years ago
It turns out there is such a unicode character -- ẞ/ß -- although based on other comments here it looks like it was added fairly recently.
Upper/Lower case stuff just seems to be at an annoying intersection where it has cultural and also programming significance. Or at least, people will use toUpper when they really want some case-insensitive sortable version of the string.
(based on some googling, probably localeCompare is the way to go in javascript at least).
3836293648|3 years ago
Hamuko|3 years ago
Yes, one that you might make if you were for example, trying to make English text uppercase. Which is why it would be daft for anyone to suggest that their country has two different English spellings depending on the character case.
d1sxeyes|3 years ago
vesinisa|3 years ago
JavaScript actually seems to be the smart one here - its default .toUpperCase() uses the "locale-insensitive case mappings in the Unicode Character Database".
underwater|3 years ago
bbu|3 years ago
korlja|3 years ago