summaryrefslogtreecommitdiffstats
path: root/pykolab
diff options
context:
space:
mode:
authorJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2013-02-08 20:56:02 +0100
committerJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2013-02-08 20:56:02 +0100
commit394c40ea1ce96a403e322ed12cc5059bd8012a47 (patch)
tree318cba7a80e053d7e86d691490c2b840f2114cfe /pykolab
parentdf61e5c367ce0915bcedb4842bf8783cdd5b116b (diff)
downloadpykolab-394c40ea1ce96a403e322ed12cc5059bd8012a47.tar.gz
Let's use utf-8 as the common denominator between ordinals
Diffstat (limited to 'pykolab')
-rw-r--r--pykolab/translit.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/pykolab/translit.py b/pykolab/translit.py
index ac4d2d7..119675f 100644
--- a/pykolab/translit.py
+++ b/pykolab/translit.py
@@ -17,6 +17,11 @@
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
+import pykolab
+from pykolab.translate import _
+
+log = pykolab.getLogger('pykolab.translit')
+
locale_translit_map = {
'ru_RU': 'cyrillic'
}
@@ -97,9 +102,11 @@ def transliterate(_input, lang, _output_expected=None):
_output = ''
- for char in _input:
+ for char in _input.decode('utf-8'):
if translit_map[_translit_name].has_key(char):
_output += translit_map[_translit_name][char]
+ elif char in [repr(x) for x in translit_map[_translit_name].keys()]:
+ _output += translit_map[_translit_name][[char in [raw(x) for x in translit_map[_translit_name].keys()]][0]]
else:
_output += char