From fd7936ff36bfe62fe7bb0a637f84027e4633319a Mon Sep 17 00:00:00 2001 From: Dimitur Kirov Date: Thu, 25 Aug 2005 08:02:41 +0000 Subject: [PATCH] fixed bug: ensure_unicode_string return None if 'string' is type unicode --- src/gtkgui_helpers.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gtkgui_helpers.py b/src/gtkgui_helpers.py index 9a82d3e72..2edb19a7d 100644 --- a/src/gtkgui_helpers.py +++ b/src/gtkgui_helpers.py @@ -88,7 +88,7 @@ def reduce_chars_newlines(text, max_chars = 0, max_lines = 0, ''' # assure that we have only unicode text text = ensure_unicode_string(text) - + def _cut_if_long(str): if len(str) > max_chars: str = str[:max_chars - 3] + '...' @@ -125,6 +125,7 @@ def escape_for_pango_markup(string): def ensure_unicode_string(string): if type(string) == str: return unicode(string, encoding = 'utf-8') + return string def autodetect_browser_mailer(): #recognize the environment for appropriate browser/mailer