toUtf8 function
Converts UTF-8 character code points to 8-bit UTF-8 octet sequence.
Parameters:
input
is a sequence of UTF-8 character code points.codec
is the UTF8Codec to use.
Implementation
Uint8List toUtf8(
String input, {
UTF8Codec codec = UTF8Codec.standard,
}) {
var out = codec.encoder.convert(input.codeUnits);
return Uint8List.fromList(out);
}