Метод convert
String convert(Преобразует UTF-8 codeUnits (список беззнаковых 8-битных целых чисел) в соответствующую строку.
Использует кодовые единицы с start по, но не включая, end. Если end опущено, оно по умолчанию равно codeUnits.length.
Если codeUnits начинается с кодировки UNICODE_BOM_CHARACTER_RUNE, этот символ отбрасывается.
Исходный код
String convert(List<int> codeUnits, [int start = 0, int end]) {
// Allow the implementation to intercept and specialize based on the type
// of codeUnits.
String result = _convertIntercepted(_allowMalformed, codeUnits, start, end);
if (result != null) {
return result;
}
int length = codeUnits.length;
RangeError.checkValidRange(start, end, length);
if (end == null) end = length;
StringBuffer buffer = new StringBuffer();
_Utf8Decoder decoder = new _Utf8Decoder(buffer, _allowMalformed);
decoder.convert(codeUnits, start, end);
decoder.flush(codeUnits, end);
return buffer.toString();
}
© 2012 the Dart project authors
Licensed under the Creative Commons Attribution-ShareAlike License v4.0.
https://api.dartlang.org/stable/1.24.3/dart-convert/Utf8Decoder/convert.html