1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-12-27 16:48:09 +00:00

src/protobuf: fix unicode serialization

This commit is contained in:
Jan Pochyla 2018-02-27 22:24:11 +01:00
parent f4c1bfda22
commit 9e5aad9ab4

View File

@ -223,8 +223,9 @@ async def dump_message(writer, msg):
await writer.awrite(svalue)
elif ftype is UnicodeType:
await dump_uvarint(writer, len(svalue))
await writer.awrite(bytes(svalue, 'utf8'))
bvalue = bytes(svalue, 'utf8')
await dump_uvarint(writer, len(bvalue))
await writer.awrite(bvalue)
elif issubclass(ftype, MessageType):
counter = CountingWriter()