decodeText static method

dynamic decodeText(
  1. List<int> array
)

Implementation

static decodeText(List<int> array) {
  var s = convert.Utf8Decoder().convert(array);
  return s;

  // if ( typeof TextDecoder !== 'undefined' ) {
  // 	return new TextDecoder().decode( array );
  // }

  // Avoid the String.fromCharCode.apply(null, array) shortcut, which
  // throws a "maximum call stack size exceeded" error for large arrays.

  // String s = '';
  // for ( var i = 0, il = array.length; i < il; i ++ ) {
  // 	// Implicitly assumes little-endian.
  // 	s += String.fromCharCode( array[ i ] );
  // }
  // return s;

  // try {

  // 	// merges multi-byte utf-8 characters.

  // 	return Uri.encodeComponent( RegExp.escape( s ) );

  // } catch ( e ) { // see #16358

  // 	return s;

  // }
}