utf8ToBytes function

List utf8ToBytes(
  1. String text
)

Implementation

List utf8ToBytes(String text) {
  List bytes = [];
  var encoded = utf8.encode(text);
  for (int i = 0; i < encoded.length; i++) {
    bytes.add(String.fromCharCode(encoded[i]).codeUnitAt(0));
  }
  return bytes;
}