utf8OffsetForUtf16Offset method
Converts a UTF-16 offset, clamping out-of-range values to source bounds.
Implementation
int utf8OffsetForUtf16Offset(int offset) {
RangeError.checkValueInInterval(offset, 0, utf16Length, 'offset');
return _utf8Offsets[_boundaryAtOrBefore(_utf16Offsets, offset)];
}