Utf8CodecConfig
Defines the configuration options for UTF-8 codecs.
Properties
fatal?
Whether to throw on invalid UTF-8 instead of silently substituting the replacement character (U+FFFD).
When encoding, strings containing lone surrogates are rejected. When decoding, malformed byte sequences are rejected.
Default Value
false
ignoreBOM?
Whether to keep a leading byte order mark (U+FEFF) in decoded strings.
By default, a leading byte order mark is stripped, as TextDecoder does.
Only applies when decoding.
Default Value
false
removeNullCharacters?
Whether to strip null characters (\u0000) from decoded strings.
This is useful when decoding fixed-size strings that are padded with null characters, but it makes the codec lossy for strings that legitimately contain null characters. Only applies when decoding.
Default Value
true