diff --git a/src/soundex.py b/src/soundex.py index c9c00d35f..19ee3f988 100644 --- a/src/soundex.py +++ b/src/soundex.py @@ -28,6 +28,7 @@ Provide soundex calculation # #------------------------------------------------------------------------- import string +import unicodedata #------------------------------------------------------------------------- # @@ -46,7 +47,8 @@ TABLE = string.maketrans('ABCDEFGIJKLMNOPQRSTUVXYZ', def soundex(strval): "Return the soundex value to a string argument." - strval = strval.upper().strip() + strval = unicodedata.normalize('NFKD', + strval.upper().strip()).encode('ASCII', 'ignore') if not strval: return "Z000" strval = strval.encode('iso-8859-1')