convert Unicode to lower/uppercase?
Martin v. Löwis
martin at v.loewis.de
Tue Sep 23 23:39:59 CEST 2003
jallan at smrtytrek.com (jallan) writes:
> A: No. The UnicodeData.txt file includes all of the 1:1 case mappings,
> but doesn't include 1:many mappings such as the one needed for
> uppercasing ß. Since many parsers now expect this file to have at most
> single characters in the case mapping fields, an additional file
> (SpecialCasing.txt) was added to provide the 1:many mappings. For more
> information, see UTR #21- Case Mappings [MD]
> Python specifications make an implied claim of full support for
> Unicode and an implied claim that the function upper() uppercases a
> string properly.
This is a contradiction: SpecialCasing contains 1:n mappings, whereas
.upper() can only return a single result. So how do you think
SpecialCasing should be considered in the implementation of .upper()?
> Users should not have to know such details. They may wish to know
> where a particular function does not do what might be expected of it.
Things are more difficult than they appear to be.
More information about the Python-list