Is unicode.lower() locale-independent?

Robert Kern robert.kern at
Sat Jan 12 23:44:27 CET 2008

Fredrik Lundh wrote:
> Robert Kern wrote:
>>> However it appears from your bug ticket that you have a much narrower
>>> problem (case-shifting a small known list of English words like VOID)
>>> and can work around it by writing your own locale-independent casing
>>> functions. Do you still need to find out whether Python unicode
>>> casings are locale-dependent?
>> I would still like to know. There are other places where .lower() is used in 
>> numpy, not to mention the rest of my code.
> "lower" uses the informative case mappings provided by the Unicode 
> character database; see
> afaik, changing the locale has no influence whatsoever on Python's 
> Unicode subsystem.

Even if towlower() gets used? I've found an explicit statement that the 
conversion it does can be locale-specific:

Thanks, Fredrik.

Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
  that is made terrible by our own mad attempt to interpret it as though it had
  an underlying truth."
   -- Umberto Eco

More information about the Python-list mailing list