Force packets encoding to utf-8

This commit is contained in:
fredericsureau 2014-03-21 18:02:03 +01:00
commit 6a5a35d84d

View file

@ -66,7 +66,7 @@ class _AbstractTransport(object):
def send_packet(self, code, path='', data='', callback=None):
packet_id = self.set_ack_callback(callback) if callback else ''
packet_parts = str(code), packet_id, path, data
packet_parts = str(code), packet_id, path, unicode(data).encode('utf-8')
packet_text = ':'.join(packet_parts)
self.send(packet_text)
_log.debug('[packet sent] %s', packet_text)