decode static method

String decode(
  1. Uint8List bytes, {
  2. int? eci,
  3. bool preferUtf8 = false,
})

Implementation

static String decode(Uint8List bytes, {int? eci, bool preferUtf8 = false}) {
  if (eci == 25) return _utf16be(bytes);
  if (eci == 20) return shiftJis(bytes);
  if (eci == 27 || eci == 170) return String.fromCharCodes(bytes.map((int b) => b & 0x7F));
  return _tryUtf8(bytes) ?? String.fromCharCodes(bytes);
}