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.

Author Carl.Friedrich.Bolz
Recipients Carl.Friedrich.Bolz
Date 2009-04-19.10:57:46
SpamBayes Score 5.4050556e-08
Marked as misclassified No
Message-id <1240138668.81.0.556481056778.issue5791@psf.upfronthosting.co.za>
In-reply-to
Content
There seems to be a problem with some unicode character's title information:

$ python2.6
Python 2.6.2c1 (release26-maint, Apr 14 2009, 08:02:48)
[GCC 4.3.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> unichr(453)
u'\u01c5'
>>> unichr(453).title()
u'\u01c4'

But the title should return the same character, according to this:

http://www.fileformat.info/info/unicode/char/01c5/index.htm

(I also checked the files that unicode.org provides). I tried to follow
the problem a bit, it seems to come from _PyUnicode_ToTitlecase in
unicodetype.c. The unicode record contains the offset of the character
to its titled version. If the character is its own titled version, then
the offset is zero. But zero is also used for when there is no
information available, so the offset to the upper-case version of the
character is used. If this is a different character (as for the example
above), the result of .title() is wrong.
History
Date User Action Args
2009-04-19 10:57:48Carl.Friedrich.Bolzsetrecipients: + Carl.Friedrich.Bolz
2009-04-19 10:57:48Carl.Friedrich.Bolzsetmessageid: <1240138668.81.0.556481056778.issue5791@psf.upfronthosting.co.za>
2009-04-19 10:57:47Carl.Friedrich.Bolzlinkissue5791 messages
2009-04-19 10:57:46Carl.Friedrich.Bolzcreate