human
Detecting non-ascii characters in unicode string
assistant
Here is some code to strip all non-ASCII characters from a unicode string, `\xa3\u20ac\xa3\u20ac`

print(set(re.sub('[\x00-\x7f]', '', '\xa3\u20ac\xa3\u20ac')))

#Warning: this code generation is experimental. Please inspect the code for any bugs before executing.