import unicodedata

def remove_accents(input_str):
    nkfd_form = unicodedata.normalize('NFKD', unicode(input_str))
    return u"".join([c for c in nkfd_form if not unicodedata.combining(c)])

u'gli devi passare un unicode'

dicci se funziona

http://stackoverflow.com/questions/517923/what-is-the-best-way-to-remove-accents-in-a-python-unicode-string




-- 
Simone Federici
------------------------
Software Craftsman
XP, Agile, Scrum, Kanban
Quality, performance & security

Explicit is better than implicit.
_______________________________________________
Python mailing list
Python@lists.python.it
http://lists.python.it/mailman/listinfo/python

Rispondere a