Create a new instance of TextEncoder.
Encode the given string into a byte array.
the string to encode.
Encode the given string and store the results in the given buffer.
the string to encode.
the buffer where the encoded string should be stored.
an object describing the progress made in this call (code points read and bytes written).
TextEncoder takes code points and returns UTF-8 bytes.