From f9657d7521f808eb042a6c3fb068a98c67e24a32 Mon Sep 17 00:00:00 2001 From: Dimitur Kirov Date: Wed, 17 Aug 2005 14:38:20 +0000 Subject: [PATCH] make check for unicode text as argument --- src/gtkgui_helpers.py | 4 ++++ 1 file changed, 4 insertions(+) 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] + '...'