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



silverburgh.meryl@xxxxxxxxx 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.
.



Relevant Pages

  • Re: python wrapper question
    ... > python function to return a list of strings. ... > at compile time? ... you can wrap the above list-building goo in a function ... and then the string array. ...
    (comp.lang.python)
  • Re: capturing the output of external commands
    ... > Is there a Python function in any of the ... > what the backticks do in Perl? ... You can fake it by redirecting the output of whatever external command ... you want to run to a file, and then reading the file into a string. ...
    (comp.lang.python)
  • Re: change the date string into timestamp
    ... >> In Php strtotime() will change a date ... >> string into timestamp. ... >> python function will change a date string ...
    (comp.lang.python)
  • Re: printing python
    ... I want to generate a DTML string that will be passed in a shell script to a python function. ... This string has newlines in it but for reasons unknown to me and only of very passing interest this function will not accept any actual returns in its string parameters. ... but it does not have the slash in front of the n in the returned string and putting two slashes leaves two slashes. ... Make sure to print out your string; Lisp repls show the return value in a format suitable to read by Lisp. ...
    (comp.lang.lisp)
  • change the date string into timestamp
    ... string into timestamp. ... python function will change a date string ... Date string format is below ...
    (comp.lang.python)