src/protobuf: fix unicode serialization

This commit is contained in:
Jan Pochyla 2018-02-27 22:24:11 +01:00
parent f4c1bfda22
commit 9e5aad9ab4
1 changed files with 3 additions and 2 deletions

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()