I need to replace all non-ASCII (\\x00-\\x7F) characters with a space. I\'m surprised that this is not dead-easy in Python, unless I\'m missing something. The following func
For you the get the most alike representation of your original string I recommend the unidecode module:
from unidecode import unidecode def remove_non_ascii(text): return unidecode(unicode(text, encoding = "utf-8"))
Then you can use it in a string:
remove_non_ascii("Ceñía") Cenia