Functions
getUtf8Codec
getUtf8Codec():
VariableSizeCodec
<string
>
Returns a codec for encoding and decoding UTF-8 strings.
This codec serializes strings using UTF-8 encoding. The encoded output contains as many bytes as needed to represent the string.
Returns
VariableSizeCodec
<string
>
A VariableSizeCodec<string>
for encoding and decoding UTF-8 strings.
Example
Encoding and decoding a UTF-8 string.
Remarks
This codec does not enforce a size boundary. It will encode and decode all bytes necessary to represent the string.
If you need a fixed-size UTF-8 codec, consider using fixCodecSize.
If you need a size-prefixed UTF-8 codec, consider using addCodecSizePrefix.
Separate getUtf8Encoder and getUtf8Decoder functions are available.