Commit f094886a authored by Taddeüs Kroes's avatar Taddeüs Kroes

Text messages payloads are not UTF-8 encoded automatically

parent 653fab90
......@@ -22,12 +22,12 @@ class Message(object):
class TextMessage(Message):
def __init__(self, payload):
super(TextMessage, self).__init__(OPCODE_TEXT, payload)
super(TextMessage, self).__init__(OPCODE_TEXT, payload.encode('utf-8'))
class BinaryMessage(Message):
def __init__(self, payload):
super(TextMessage, self).__init__(OPCODE_BINARY, payload)
super(BinaryMessage, self).__init__(OPCODE_BINARY, payload)
OPCODE_CLASS_MAP = {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment