API reference › @evolu/common › Bytes › encodeString
function encodeString(buffer: Buffer, value: string): void;
Defined in: packages/common/src/Bytes.ts:533
Encodes a length-prefixed UTF-8 string.
A lone surrogate becomes U+FFFD, so the bytes are always valid UTF-8. Unlike encodeJsonValue, which keeps lone surrogates, this does not round-trip every JavaScript string.