3 ms·
Strings are serialized as (type code) (uint16 length) (string contents) (null byte). In the API, the string length is determined the normal way in each languag
by edflsafoiewq 2y ago
Strings are serialized as (type code) (uint16 length) (string contents) (null byte).
In the API, the string length is determined the normal way in each language: strlen() in C, len() in Python. The trailing NUL allows the C decoder to return just a pointer to the string (without allocating).
So internal null bytes and strings longer than 0xFFFF are functionally prohibited.