Is there a string function to trim all non-ascii characters out of a string

Michael Ströder michael at stroeder.com
Mon Dec 31 07:40:46 EST 2007


silverburgh.meryl at gmail.com wrote:
> 
> Is there a string function to trim all non-ascii characters out of a
> string?
> Let say I have a string in python (which is utf8 encoded), is there a
> python function which I can convert that to a string which composed of
> only ascii characters?

I'd recommend to rethink this approach.
In the worst case the result is an empty string... ;-)

Ciao, Michael.



More information about the Python-list mailing list