Create an encoder for a supported one-byte encoding, given its lowercased name encoding.
encoding
Returns a function encode(string) that encodes a string to bytes.
encode(string)
In 'fatal' mode (default), will throw on non well-formed strings or any codepoints which could not be encoded in the target encoding.
'fatal'
The encoding name (e.g., 'iso-8859-1', 'windows-1252')
Optional
Encoding options
Encoding mode (default: 'fatal'). Currently, only 'fatal' mode is supported.
A function that encodes string to bytes
Create an encoder for a supported one-byte
encoding, given its lowercased nameencoding.Returns a function
encode(string)that encodes a string to bytes.In
'fatal'mode (default), will throw on non well-formed strings or any codepoints which could not be encoded in the target encoding.