This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: CaseFolding not working properly
Type: Stage:
Components: Versions: Python 3.3
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: benjamin.peterson, chris.jerdonek, flox, loewis, vstinner
Priority: normal Keywords:

Created on 2012-08-05 21:39 by loewis, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Messages (4)
msg167515 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2012-08-05 21:39
IIUC, Python 3.3 is intended to support CaseFolding.txt. In

http://unicode.org/Public/UNIDATA/CaseFolding.txt

U+00B5 maps to U+03BC. However, in 3.3.0b1 (80a1ae3a1b39), ascii('\u00b5'.lower()) gives '\xb5'.
msg167516 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2012-08-05 21:57
Hum, strange.

$ ./python 
Python 3.3.0b1 (default:b7b8e4ada3e5+, Aug  5 2012, 16:19:18) 
[GCC 4.6.3 20120306 (Red Hat 4.6.3-2)] on linux
>>> print(ascii('\xb5'.casefold()))
'\u03bc'
msg167517 - (view) Author: Benjamin Peterson (benjamin.peterson) * (Python committer) Date: 2012-08-05 21:58
Naturally, you have to use casefold():

>>> hex(ord("\u00b5".casefold()))
'0x3bc'
msg167518 - (view) Author: Chris Jerdonek (chris.jerdonek) * (Python committer) Date: 2012-08-05 22:00
Yes, the documentation for str.casefold() suggests that lower() is not meant to casefold:

"For example, the German lowercase letter 'ß' is equivalent to "ss". Since it is already lowercase, lower() would do nothing to 'ß'; casefold() converts it to "ss"."

http://docs.python.org/dev/library/stdtypes.html#str.casefold
History
Date User Action Args
2022-04-11 14:57:33adminsetgithub: 59767
2012-08-05 22:00:33chris.jerdoneksetnosy: + chris.jerdonek
messages: + msg167518
2012-08-05 21:59:08benjamin.petersonsetstatus: pending -> closed
2012-08-05 21:58:44benjamin.petersonsetstatus: open -> pending
resolution: not a bug
messages: + msg167517
2012-08-05 21:57:43vstinnersetnosy: + vstinner
messages: + msg167516
2012-08-05 21:56:09floxsetnosy: + flox
2012-08-05 21:39:35loewiscreate