Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Clear category for Remove Accents by johan4622
import unicodedata
def checkio(in_string):
text = unicodedata.normalize('NFD', in_string)
text = text.encode('ascii', 'ignore')
text = text.decode("utf-8")
return str(text) if len(text) > 0 else in_string
# These "asserts" using only for self-checking and not necessary for auto-testing
if __name__ == '__main__':
assert checkio(u"préfèrent") == u"preferent"
assert checkio(u"loài trăn lớn") == u"loai tran lon"
print('Done')
Dec. 21, 2018