Hi,

I want to substitute some letters with accents with theire non-accented 
equivalents. It should be easy, but it doesn't work. What am I doing wrong?

trans = {}
funnychars = u"éèêëóòôöáàâäÉÈÊËÓÒÔÖÁÀÂÄ"
asciichars = "eeeeooooaaaaEEEEOOOOAAAA"
for f, a in zip(funnychars, asciichars):
    trans.update({f: a})
print funnychars.translate(trans) # why doesn't this return the letters without 
accents?

Cheers!!

Albert-Jan



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

In the face of ambiguity, refuse the temptation to guess.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


      
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to