From 68b3f2e54395c1ef8f9c5a843e7e1f1eeff219bc Mon Sep 17 00:00:00 2001 From: Yuxin Wu Date: Fri, 29 Apr 2016 11:14:34 -0400 Subject: [PATCH] fix printing --- libchat/libchat.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libchat/libchat.py b/libchat/libchat.py index 360dc6a..7a401df 100644 --- a/libchat/libchat.py +++ b/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)