4 ms·
A Friday challenge: In Python when is u'ß'.upper() equal to u'SS'? I discovered one case today, there may be others. Answer: https://twitter.com/moreati/status
by moreati 13y ago
A Friday challenge: In Python when is u'ß'.upper() equal to u'SS'?
I discovered one case today, there may be others. Answer: https://twitter.com/moreati/status/332910618858364928 https://twitter.com/moreati/status/332910618858364928
- kzrdude 13y agoAnd will it equal 'ẞ' in a later update? http://opentype.info/blog/2013/04/22/capital-sharp-s-in-use/ http://opentype.info/blog/2013/04/22/capital-sharp-s-in-use/
- safod 13y agoActually, this is a bug. Unicode codepoint U+1E9E is LATIN CAPITAL LETTER SHARP S and should be the result of u"ß".upper(). This is especially so because otherwise u"Maße".upper() (Maße means measures) returns "MASSE", which could be confused with u"Masse".upper() (Masse means mass). In such cases, where confusion is possible and no uppercase ß is available, the German dictionary Duden actually suggests using SZ instead. Therefore, u"Maße".upper() would have to return "MASZE". However, since the Python string processing routines can hardly carry a dictionary around just to check whether there is a similar word that would have the same uppercase spelling, this is obviously not feasible. U+1E9E would be the way to go.
- ygra 13y agoAccording to Unicode ß gets converted to SS in uppercase. This is by definition and doesn't change (stability policies, as far as I recall). Even in German you'll never see ß capitalised as SZ (except when I do it, but I'm a very, very small minority – and now I'm more likely to use ẞ).