distributed: ensure string is utf-8 encoded

This commit is contained in:
John Cote 2019-12-30 17:08:08 -05:00
parent c54f469f37
commit 99bc426759
1 changed files with 1 additions and 1 deletions

View File

@ -77,7 +77,7 @@ def msgpack_encode(dg, element):
# Logstash bundles a MsgPack implementation SO OLD that this isn't
# handled correctly so this function avoids it too
msgpack_length(dg, len(element), 0xa0, 0x20, None, 0xda, 0xdb)
dg.appendData(element.encode())
dg.appendData(element.encode('utf-8'))
elif isinstance(element, float):
# Python does not distinguish between floats and doubles, so we send
# everything as a double in MsgPack: