python remove accents

Solutions on MaxInterview for python remove accents by the best coders in the world

showing results for - "python remove accents"
Lara
30 Oct 2016
1def simplify(text):
2	import unicodedata
3	try:
4		text = unicode(text, 'utf-8')
5	except NameError:
6		pass
7	text = unicodedata.normalize('NFD', text).encode('ascii', 'ignore').decode("utf-8")
8	return str(text)