Open drathier opened 5 years ago
🤔 this is something we've inherited by making a façade over String
, and in fact we're passing directly through to String.
I see two ways forward:
@drathier would you mind moving this issue to elm/core? I don't think we're going to fix it here.
String.toUpper
only handlesa-z
. This breaks Swedish, for example.åsa
gets uppercased toåSA
instead ofÅSA
, assuming theå
character is a single code point.Unfortunately, which lowercase characters correspond to what uppercase characters is locale-dependent, so implementing a non-ascii version is tricky. https://stackoverflow.com/questions/12537377/in-haskell-how-can-i-uppercase-a-unicode-character-with-respect-to-current-local
I'd suggest dropping these functions and using css (
text-transform: uppercase
) to uppercase/lowercase written strings, hoping that the browser locale is correct most of the time. For case-insensitive string comparisons, there's unicode normalization algorithms which can be used.