utf - string translation

Fredrik Lundh fredrik at pythonware.com
Wed Nov 22 14:18:13 EST 2006


hg wrote:

> How would you handle the string.maketrans then ?

maketrans works on bytes, not characters.  what makes you think that you 
can use maketrans if you haven't gotten the slightest idea what's in the 
string?

if you want to get rid of accents in a Unicode string, you can do the 
approaches described here

     http://www.peterbe.com/plog/unicode-to-ascii

or here

     http://effbot.org/zone/unicode-convert.htm

which both works on any Unicode string.

</F>




More information about the Python-list mailing list