result = []
for word in _punct_re.split(text.lower()):
    word = normalize('NFKD', word).encode('ascii', 'ignore')
if word:
    result.append(word)
return str(delim.join(result))
Normalizing unicode text to filenames, etc. in Python