>>> import msgpack >>> packed = msgpack.packb([b'spam', u'egg'], use_bin_type=True) >>> msgpack.unpackb(packed, encoding='utf-8') ['spam', u'egg']
http://msgpack.org/ https://github.com/vsergeev/u-msgpack-python