<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;">Hi,<br><br>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?<br><br>trans = {}<br>funnychars = u"éèêëóòôöáàâäÉÈÊËÓÒÔÖÁÀÂÄ"<br>asciichars = "eeeeooooaaaaEEEEOOOOAAAA"<br>for f, a in zip(funnychars, asciichars):<br> trans.update({f: a})<br>print funnychars.translate(trans) # why doesn't this return the letters without accents?<br><br>Cheers!!<br>
Albert-Jan<br>
<br>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br>
In the face of ambiguity, refuse the temptation to guess.<br>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~</td></tr></table><br>