Skip to content
Snippets Groups Projects
Commit 58149b48 authored by nkour's avatar nkour
Browse files

ensure unicode string func and using it in one more place

parent cfe99c0a
No related branches found
No related tags found
No related merge requests found
......@@ -1003,7 +1003,7 @@ class GroupchatWindow(chat.Chat):
self.xmls[room_jid] = gtk.glade.XML(GTKGUI_GLADE, 'gc_vbox', APP)
self.childs[room_jid] = self.xmls[room_jid].get_widget('gc_vbox')
chat.Chat.new_tab(self, room_jid)
self.nicks[room_jid] = nick
self.nicks[room_jid] = gtkgui_helpers.ensure_unicode_string(nick)
self.subjects[room_jid] = ''
self.room_creation[room_jid] = time.time()
self.nick_hits[room_jid] = []
......@@ -1086,7 +1086,7 @@ class GroupchatWindow(chat.Chat):
return
room_jid = self.get_active_jid()
nick = model[iter][1]
if nick != 'moderator' and nick !='participant' :
if nick != 'moderator' and nick != 'participant':
account = self.account
img = model[iter][0]
......
......@@ -87,8 +87,7 @@ def reduce_chars_newlines(text, max_chars = 0, max_lines = 0,
on it is not performed
'''
# assure that we have only unicode text
if type(text) == str:
text = unicode(text, encoding='utf-8')
text = ensure_unicode_string(text)
def _cut_if_long(str):
if len(str) > max_chars:
......@@ -123,6 +122,10 @@ def escape_for_pango_markup(string):
return escaped_str
def ensure_unicode_string(string):
if type(string) == str:
return unicode(string, encoding = 'utf-8')
def autodetect_browser_mailer():
#recognize the environment for appropriate browser/mailer
if os.path.isdir('/proc'):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment