tb on utf-8 nick

This commit is contained in:
Dimitur Kirov 2005-08-24 12:45:24 +00:00
parent d065e3a289
commit c522dcedbb
1 changed files with 8 additions and 3 deletions

View File

@ -694,8 +694,8 @@ class GroupchatWindow(chat.Chat):
"""Print a line in the conversation: """Print a line in the conversation:
if contact is set: it's a message from someone if contact is set: it's a message from someone
if contact is not set: it's a message from the server""" if contact is not set: it's a message from the server"""
if type(text) == unicode: if type(text) == str:
text = text.encode('utf-8') text = unicode(text, 'utf-8')
other_tags_for_name = [] other_tags_for_name = []
other_tags_for_text = [] other_tags_for_text = []
if contact: if contact:
@ -706,8 +706,13 @@ class GroupchatWindow(chat.Chat):
else: else:
kind = 'status' kind = 'status'
# nick can be unicode or utf-8
nick = self.nicks[room_jid]
if type(nick) == str:
nick = unicode(nick, 'utf-8')
if kind == 'incoming' and \ if kind == 'incoming' and \
text.lower().find(self.nicks[room_jid].lower()) != -1: text.lower().find(nick.lower()) != -1:
other_tags_for_name.append('bold') other_tags_for_name.append('bold')
other_tags_for_text.append('marked') other_tags_for_text.append('marked')