I need to change some characters that are not ASCII to \'_\'. For example,
Tannh‰user -> Tannh_user
re.sub(r'[^\x00-\x7F]', '_', theString)
This will work if theString is unicode, or a string in an encoding where ASCII occupies values 0 to 0x7F (latin-1, UTF-8, etc.).