String

Specification for the ser/de of strings

Strings can be in the UTF-8 or 16 formats. They are length-prefixed by two bytes yielding a maximum length of 65,536.

The syntax for strings are the following

[TypeID, Length, Data]

TypeID can be either a UTF-8 or UTF-16 string ID.

String8ID = 11

String16ID = 12

The UTF-8 encoded form of "hello" would be

[11, 5, 104, 101, 108, 108, 111]

Last updated