[issue7008] str.title() misbehaves with apostrophes

Marc-Andre Lemburg report at bugs.python.org
Tue Sep 29 12:40:55 CEST 2009


Marc-Andre Lemburg <mal at egenix.com> added the comment:

Christoph Burgmer wrote:
> 
> Christoph Burgmer <cburgmer at ira.uka.de> added the comment:
> 
> I admit I don't fully understand the semantics of capwords().

string.capwords() is an old function from the days before Unicode.
The function is basically defined by its implementation.

> But from
> what I believe what it should do, this function could be happily
> replaced by the word-breaking algorithm as defined in
> http://www.unicode.org/reports/tr29/.
> 
> This algorithm should be implemented anyway, to properly solve
> issue6412.

Simple word breaking would be nice to have in Python as new
Unicode method, e.g. .splitwords().

Note however, that word boundaries are just as complicated as casing:
there are lots of special cases in different languages or locales
(see the notes after the word boundary rules in the TR29).

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue7008>
_______________________________________


More information about the Python-bugs-list mailing list