web/hdabo/utils.py
changeset 72 ba8ebabbaece
parent 56 e70cbbc093cc
child 74 85f7f99c044c
equal deleted inserted replaced
70:c86fa4a358d7 72:ba8ebabbaece
   341 ## end of http://code.activestate.com/recipes/576693/ }}}
   341 ## end of http://code.activestate.com/recipes/576693/ }}}
   342 
   342 
   343 def remove_accents(str):
   343 def remove_accents(str):
   344     nkfd_form = unicodedata.normalize('NFKD', unicode(str))
   344     nkfd_form = unicodedata.normalize('NFKD', unicode(str))
   345     return u"".join([c for c in nkfd_form if not unicodedata.combining(c)])
   345     return u"".join([c for c in nkfd_form if not unicodedata.combining(c)])
       
   346 
       
   347 def normalize(str):
       
   348     return remove_accents(str).lower()