Encodes a string into a Uint8Array containing UTF-8 bytes.
Uint8Array
encode(string)
string
A string to encode.
new TextEncoder().encode("hello")
Uint8Array [104, 101, 108, 108, 111]