ensure unicode string func and using it in one more place
This commit is contained in:
parent
cfe99c0a4f
commit
58149b4810
|
@ -1003,7 +1003,7 @@ class GroupchatWindow(chat.Chat):
|
||||||
self.xmls[room_jid] = gtk.glade.XML(GTKGUI_GLADE, 'gc_vbox', APP)
|
self.xmls[room_jid] = gtk.glade.XML(GTKGUI_GLADE, 'gc_vbox', APP)
|
||||||
self.childs[room_jid] = self.xmls[room_jid].get_widget('gc_vbox')
|
self.childs[room_jid] = self.xmls[room_jid].get_widget('gc_vbox')
|
||||||
chat.Chat.new_tab(self, room_jid)
|
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.subjects[room_jid] = ''
|
||||||
self.room_creation[room_jid] = time.time()
|
self.room_creation[room_jid] = time.time()
|
||||||
self.nick_hits[room_jid] = []
|
self.nick_hits[room_jid] = []
|
||||||
|
@ -1086,7 +1086,7 @@ class GroupchatWindow(chat.Chat):
|
||||||
return
|
return
|
||||||
room_jid = self.get_active_jid()
|
room_jid = self.get_active_jid()
|
||||||
nick = model[iter][1]
|
nick = model[iter][1]
|
||||||
if nick != 'moderator' and nick !='participant' :
|
if nick != 'moderator' and nick != 'participant':
|
||||||
account = self.account
|
account = self.account
|
||||||
|
|
||||||
img = model[iter][0]
|
img = model[iter][0]
|
||||||
|
|
|
@ -87,8 +87,7 @@ def reduce_chars_newlines(text, max_chars = 0, max_lines = 0,
|
||||||
on it is not performed
|
on it is not performed
|
||||||
'''
|
'''
|
||||||
# assure that we have only unicode text
|
# assure that we have only unicode text
|
||||||
if type(text) == str:
|
text = ensure_unicode_string(text)
|
||||||
text = unicode(text, encoding='utf-8')
|
|
||||||
|
|
||||||
def _cut_if_long(str):
|
def _cut_if_long(str):
|
||||||
if len(str) > max_chars:
|
if len(str) > max_chars:
|
||||||
|
@ -123,6 +122,10 @@ def escape_for_pango_markup(string):
|
||||||
|
|
||||||
return escaped_str
|
return escaped_str
|
||||||
|
|
||||||
|
def ensure_unicode_string(string):
|
||||||
|
if type(string) == str:
|
||||||
|
return unicode(string, encoding = 'utf-8')
|
||||||
|
|
||||||
def autodetect_browser_mailer():
|
def autodetect_browser_mailer():
|
||||||
#recognize the environment for appropriate browser/mailer
|
#recognize the environment for appropriate browser/mailer
|
||||||
if os.path.isdir('/proc'):
|
if os.path.isdir('/proc'):
|
||||||
|
|
Loading…
Reference in New Issue