Encodes a string to binary data using the specified character encoding.
string is the string to encode.
string
Returns the binary representation of the string as Uint8List.
Uint8List encode(String string);