utf16_index_to_utf8
function · ferroui-base · v0.5.0
fn utf16_index_to_utf8(text: &str, utf16_index: usize) -> usize
Converts a UTF-16 code unit index into text to the UTF-8 byte offset of
the same position. An index inside a surrogate pair maps to the start of
that character; an index past the end maps to text.len().
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.