Dear All,

I have some utf-8 unicode text with lines like this:

ANVERS-LE-HOMONT, Maine.
ANGOULÊME, Angoumois.
ANDELY (le Petit), Normandie.

which I'm using as-is in this line of code:

place.append(line.strip())

What I would prefer would be something like this:

place.append(line.title().strip())

which works for most lines, giving me, for example:

Anvers-Le-Homont, Maine.
and
Andely (Le Petit), Normandie.

but where there are diacritics involved, title() gives me:

AngoulÊMe, Angoumois.

Can anyone give the clueless a clue on how to manage such unicode strings more effectively?

Many thanks,
Jon
_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to