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