Marc-Andre Lemburg added the comment: On 24.06.2013 00:52, Alexander Belopolsky wrote: > > Alexander Belopolsky added the comment: > > There has been a relatively recent discussion of case mappings under #12753 > (msg144836). > > I personally agree with Martin: str.upper/lower should remain the way it is - > a simplistic 1-to-1 mapping using UnicodeData.txt fields. More sophisticated > case mapping algorithms belong to a specialized library module not python > core. > > The behavior of .title() and .capitalize() is harder to defend, so if someone > can point out to a python library (PyICU?) that gets it right we can > reference it in the documentation.
.title() and .capitalize() are 1-1 mappings as well. Python only supports "Simple Case Operations" and does not support "Full Case Operations" which require parsing context (SpecialCasing.txt). ICU does provide support for both: http://userguide.icu-project.org/transforms/casemappings PyICU wraps ICU, but it is not clear to me how you'd access those mappings (the package doesn't provide dcoumentation on the API, instead just gives a description of how to map the C++ API to a Python one): https://pypi.python.org/pypi/PyICU ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue4610> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com