Use bytesize String method instead of length in protocol.

Needed for correct handling of strings, which contain multibyte chars.