Re: Is there a string function to trim all non-ascii characters out of a string
- From: Steven D'Aprano <steve@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Mon, 31 Dec 2007 11:05:47 -0000
On Mon, 31 Dec 2007 01:09:09 -0800, John Machin wrote:
On Dec 31, 7:20 pm, "silverburgh.me...@xxxxxxxxx"
<silverburgh.me...@xxxxxxxxx> wrote:
Hi,OK, I'll bite: why do you want to throw data away?
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?
Maybe he has to send the data to a device that can't deal with more than
7-bit ASCII.
Maybe he's sick of seeing text with "missing character" squares all over
from all the characters that his fonts can't display.
Maybe the string ends up as a file name on an operating system that
doesn't support unicode.
Or maybe he's just a curmudgeon who thinks life was better when there
were only 128 characters available.
--
Steven
.
- References:
- Is there a string function to trim all non-ascii characters out of a string
- From: silverburgh.meryl@xxxxxxxxx
- Re: Is there a string function to trim all non-ascii characters out of a string
- From: John Machin
- Is there a string function to trim all non-ascii characters out of a string
- Prev by Date: Re: Bizarre behavior with mutable default arguments
- Next by Date: Re: at what complexity, a comparison fails ?
- Previous by thread: Re: Is there a string function to trim all non-ascii characters out of a string
- Next by thread: Re: Is there a string function to trim all non-ascii characters out of a string
- Index(es):
Relevant Pages
|