I have this function to remove accents in a word
def remove_accents(word): return ''.join(x for x in unicodedata.normalize('NFKD', word) if x in string.ascii_letters) But when I run it it shows an error
UnicodeDecodeError: 'ascii' codec can't decode byte 0xf3 in position 3: ordinal not in range(128) The character in position 3 is : ó
remove_accents(u"foóbar")correctly returnsu"foobar"