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: title() uppercases latin1 strings after accented letters
Type: Stage:
Components: Interpreter Core Versions: Python 2.4
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: hyeshik.chang, virtualspirit
Priority: low Keywords:

Created on 2005-10-15 00:08 by virtualspirit, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (2)
msg26606 - (view) Author: Humberto Diógenes (virtualspirit) Date: 2005-10-15 00:08
When using latin1, the title() method of strings considers accented 
letters as word separators. The same thing doesn't happen with 
unicode strings:

>>> print u'diógenes'.title()
Diógenes
>>> print 'diógenes'.title()
DióGenes


I'm using Python 2.4.2 on Ubuntu Breezy with 'utf-8' as default 
encoding.
msg26607 - (view) Author: Hyeshik Chang (hyeshik.chang) * (Python committer) Date: 2005-10-15 02:55
Logged In: YES 
user_id=55188

String methods are locale-dependent. You should set locale
LC_CTYPE) to use such methods.

>>> print 'diógenes'.title()
DióGenes
>>> import locale
>>> locale.setlocale(locale.LC_ALL, '')
'fr_FR.ISO8859-1'
>>> print 'diógenes'.title()
Diógenes


And, string manipulation methods only works for single byte
character encodings. So the usage will not work for UTF-8 or
others.
History
Date User Action Args
2022-04-11 14:56:13adminsetgithub: 42487
2005-10-15 00:08:46virtualspiritcreate