utf - string translation

hg hg at nospam.com
Wed Nov 22 20:21:57 CET 2006


Fredrik Lundh wrote:
> 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>
> 
Thanks



More information about the Python-list mailing list