Skip to content

Commit

Permalink
Fixed transliterate on Python 3
Browse files Browse the repository at this point in the history
  • Loading branch information
jpvanhal committed Jun 15, 2013
1 parent 58b0016 commit 1ab2e0f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions inflection.py
Original file line number Diff line number Diff line change
Expand Up @@ -365,12 +365,13 @@ def transliterate(string):
Examples::
>>> transliterate(u'älämölö')
'alamolo'
u'alamolo'
>>> transliterate(u'Ærøskøbing')
'rskbing'
u'rskbing'
"""
return unicodedata.normalize('NFKD', string).encode('ascii', 'ignore')
normalized = unicodedata.normalize('NFKD', string)
return normalized.encode('ascii', 'ignore').decode('ascii')


def underscore(word):
Expand Down

0 comments on commit 1ab2e0f

Please sign in to comment.