How is the string length determined?
How does this handle packed bits/ and odd sized numbers, for example a 5 bit digit and 3 flags
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.