uproot.serialization.string

Defined in uproot.serialization on line 19.

uproot.serialization.string(data)

Converts a Python string into bytes, ready to be written to a file.

If the string’s byte representation (UTF-8) has fewer than 255 bytes, it is preceded by a 1-byte length; otherwise, it is preceded by b'ÿ' and a 4-byte length.