pub fn byte_of_index(s: &str, idx: U16Index) -> usizeExpand description
The UTF-8 byte offset corresponding to a UTF-16 index into s. An index
that falls inside a surrogate pair rounds down to the start of that code
point, so the result is always a valid str boundary.