fromUtf8 function

String fromUtf8(
  1. List<int> input, {
  2. UTF8Codec codec = UTF8Codec.standard,
})

Converts 8-bit UTF-8 octet sequence to UTF-8 character code points.

Parameters:

  • input should be a valid UTF-8 octet sequence.
  • codec is the UTF8Codec to use.

Throws:

This implementation can handle both uppercase and lowercase alphabets. If a partial string is detected, the following bits are assumed to be zeros.

Implementation

String fromUtf8(
  List<int> input, {
  UTF8Codec codec = UTF8Codec.standard,
}) {
  var out = codec.decoder.convert(input);
  return String.fromCharCodes(out);
}