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:

Implementation

@pragma('vm:prefer-inline')
@pragma('dart2js:tryInline')
String fromUtf8(
  List<int> input, {
  UTF8Codec codec = UTF8Codec.standard,
}) =>
    codec.decoder.decode(
      input is Uint8List ? input : Uint8List.fromList(input),
    );