Convert a Unicode string to a string in Python (containing extra symbols)

williamtroup picture williamtroup · Jul 30, 2009 · Viewed 986.9k times · Source

How do you convert a Unicode string (containing extra characters like £ $, etc.) into a Python string?

Answer

Sorantis picture Sorantis · Jul 30, 2009

See unicodedata.normalize

title = u"Klüft skräms inför på fédéral électoral große"
import unicodedata
unicodedata.normalize('NFKD', title).encode('ascii', 'ignore')
'Kluft skrams infor pa federal electoral groe'