unicode-to-ascii: replace with space, not "?"

Allen Fowler allen.fowler at yahoo.com
Thu Oct 15 04:08:53 CEST 2009


I've been using "data.encode('ascii','replace')" to force an ASCII string out of Unicode data, with "?" in the place of non-ASCII letters.

However, now I want to use a blank space (or maybe a dash) instead of a question mark.

How do I do this?

Thank you,


More information about the Python-list mailing list