Browse Source

fix printing

Yuxin Wu 10 năm trước cách đây
mục cha
commit
68b3f2e543
1 tập tin đã thay đổi với 2 bổ sung1 xóa
  1. 2 1
      libchat/libchat.py

+ 2 - 1
libchat/libchat.py

@@ -27,7 +27,8 @@ ChatMsgBase = namedtuple('ChatMsgBase',
 class ChatMsg(ChatMsgBase):
     def __repr__(self): # repr must return str?
         return "Msg@{}/{}-{}/{}/{}/{}/{}".format(
-            self.time, self.sender, self.chatroom,
+            self.time, self.sender.encode('utf-8'),
+            self.chatroom.encode('utf-8'),
             self.text.encode('utf-8'), 'IMG' if self.image else '',
             'AUD' if self.sound else '', self.extra_data)