This class converts Latin-1 bytes (lists of unsigned 8-bit integers) to a string.
Example:
final latin1Decoder = latin1.decoder; const encodedBytes = [224, 225, 226, 227, 228, 229]; final decoded = latin1Decoder.convert(encodedBytes); print(decoded); // àáâãäå // Hexadecimal values as source const hexBytes = [0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5]; final decodedHexBytes = latin1Decoder.convert(hexBytes); print(decodedHexBytes); // àáâãäå
Throws a FormatException if the encoded input contains values that are not in the range 0 .. 255 and allowInvalid is false ( the default ).
If allowInvalid is true, invalid bytes are converted to Unicode Replacement character U+FFFD (�).
Example with allowInvalid set to true:
const latin1Decoder = Latin1Decoder(allowInvalid: true); const encodedBytes = [300]; final decoded = latin1Decoder.convert(encodedBytes); print(decoded); // �
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/Latin1Decoder-class.html