Re:In the Turkish locale, "INFO".lower() != "info"
by price on Monday August 17, 2020 @07:52PM
(#24193668)
You'll be glad to hear that Python did stop doing this: Python 3 has never behaved this way, and its `lower` and `upper` methods have always been independent of your locale or anything else from your system.
The workaround in the OP was added in 2006 (note the reference to an issue on "SF", i.e. SourceForge -- another era!), and is now long obsolete.
Re:In the Turkish locale, "INFO".lower() != "info"
by decafbad on Monday August 17, 2020 @08:08PM
(#24193797)
Very much so. Thanks.
Re:In the Turkish locale, "INFO".lower() != "info"
by netsharc on Sunday August 16, 2020 @05:58PM
(#24181716)
> lowercaseTR()
Huh, that works well if we know the input string is in Turkish. What if this information is not available as you're writing the code?
And what will lowercase()/uppercase() be hard coded to do, and what are they supposed to output when the input isn't ASCII?
You can just make string lowercase() uppercase() function work the same everywhere, regardless of locale settings. Provide a special case function lowercaseTR() or so. This works very well in Go.
By the way, Azerbaijan has the same problem because they accepted help from wrong guys when they switched to Latin.