Converts ASCII bytes to string.
Example:
const asciiDecoder = AsciiDecoder(); final asciiValues = [68, 97, 114, 116]; final result = asciiDecoder.convert(asciiValues); print(result); // Dart
Throws a FormatException if bytes contains values that are not in the range 0 .. 127, and allowInvalid is false (the default).
If allowInvalid is true, any byte outside the range 0..127 is replaced by the Unicode replacement character, U+FFFD ('�').
Example with allowInvalid set to true:
const asciiDecoder = AsciiDecoder(allowInvalid: true); final asciiValues = [68, 97, 114, 116, 20, 0xFF]; final result = asciiDecoder.convert(asciiValues); print(result); // Dart � print(result.codeUnits.last.toRadixString(16)); // fffd
stream. Converter<RS, RT> view of this stream transformer. bytes (a list of unsigned 7- or 8-bit integers) to the corresponding string. this with other.
© 2012 the Dart project authors
Licensed under the BSD 3-Clause "New" or "Revised" License.
https://api.dart.dev/stable/2.18.5/dart-convert/AsciiDecoder-class.html