fix: marshall multi-byte strings correctly (#261)

This commit is contained in:
J. Nick Koston
2023-10-04 13:37:39 -04:00
committed by GitHub
parent f9e5d1d020
commit 4de31a3646
3 changed files with 49 additions and 1 deletions

View File

@@ -68,7 +68,7 @@ class Marshaller:
def _write_string(self, value: _str) -> int:
value_bytes = value.encode()
value_len = len(value)
value_len = len(value_bytes)
written = self._align(4) + 4
buf = self._buf
buf += PACK_UINT32(value_len)