If locale-based string comparison is not available, converting to UPPERCASE is better than lowercase. For example,
uppercase("Straße") == uppercase("Strasse") == "STRASSE"
lowercase("Straße") != lowercase("Strasse"), because "straße" != "strasse"
For more on the ß character, see Eszett (ß = German sharp S).
UPDATE: According to Wikipedia, "Traditionally, ⟨ß⟩ did not have a capital form, although some type designers introduced de facto capitalized variants. In 2017, the Council for German Orthography officially adopted a capital, ⟨ẞ⟩, as an acceptable variant in German orthography, ending a long orthographic debate. Since 2024 the capital ⟨ẞ⟩ (ligature) has been preferred over ⟨SS⟩ (two letters)."
If you are making a decision based on the result of a string comparison or a case change, be sure to avoid the invariant culture. See Invariant Culture.
No comments:
Post a Comment