diff options
author | Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com> | 2011-11-16 00:52:00 +0000 |
---|---|---|
committer | Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com> | 2011-11-16 00:52:00 +0000 |
commit | 7e1324dad409e2f9319c3347f071364f0c8f12aa (patch) | |
tree | 0154c710129ccf932f88d7250cf6abce35d87032 /pykolab/utils.py | |
parent | 31405a32477129f1f8a1a916ffb90b790aaf8949 (diff) | |
download | pykolab-7e1324dad409e2f9319c3347f071364f0c8f12aa.tar.gz |
The recipient policy should recognize special characters in a given name or surname, and replace them with the equivalent ascii valid in an email address.
This fixes #509.
Diffstat (limited to 'pykolab/utils.py')
-rw-r--r-- | pykolab/utils.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/pykolab/utils.py b/pykolab/utils.py index d787eab..079a48c 100644 --- a/pykolab/utils.py +++ b/pykolab/utils.py @@ -207,6 +207,14 @@ def pop_empty_from_list(_input_list): def standard_root_dn(domain): return 'dc=%s' %(',dc='.join(domain.split('.'))) +def translate(mystring): + chars = ['Ä', 'Ü', 'Ö', 'ä', 'ü', 'ö', 'ß'] + simple = ['Ae', 'Ue', 'Oe', 'ae', 'ue', 'oe', 'ss'] + + for num in range(0, len(chars)): + mystring = mystring.replace(chars[num], simple[num]) + return mystring + def is_service(services): """ Checks each item in list services to see if it has a RC script in |