getUtf8Encoder
Returns an encoder for UTF-8 strings.
This encoder serializes strings using UTF-8 encoding. The encoded output contains as many bytes as needed to represent the string.
For more details, see getUtf8Codec.
Parameters
| Parameter | Type | Description |
|---|---|---|
config? | Omit<Utf8CodecConfig, "ignoreBOM" | "removeNullCharacters"> | Optional configuration for the encoder. Only fatal applies when encoding. |
Returns
VariableSizeEncoder<string>
A VariableSizeEncoder<string> for encoding UTF-8 strings.
Example
Encoding a UTF-8 string.