Welcome to mirror list, hosted at ThFree Co, Russian Federation.

dev.gajim.org/gajim/gajim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDimitur Kirov <dkirov@gmail.com>2005-08-17 18:38:20 +0400
committerDimitur Kirov <dkirov@gmail.com>2005-08-17 18:38:20 +0400
commitf9657d7521f808eb042a6c3fb068a98c67e24a32 (patch)
tree319fa4b0be9fe1254910352e6e50903d0cc3287c
parent7c9ea41c1b753000069d03b19cd57eb8337f50ef (diff)
make check for unicode text as argument
-rw-r--r--src/gtkgui_helpers.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/gtkgui_helpers.py b/src/gtkgui_helpers.py
index 7b0569722..920477a53 100644
--- a/src/gtkgui_helpers.py
+++ b/src/gtkgui_helpers.py
@@ -86,6 +86,10 @@ def reduce_chars_newlines(text, max_chars = 0, max_lines = 0,
If any of the params is not present(None or 0) the action
on it is not performed
'''
+ # assure that we have only unicode text
+ if type(text) == str:
+ text = unicode(text, encoding='utf-8')
+
def _cut_if_long(str):
if len(str) > max_chars:
str = str[:max_chars - 3] + '...'