Skip to main content

utf16_to_byte_offset

Function utf16_to_byte_offset 

Source
pub fn utf16_to_byte_offset(s: &str, units: usize) -> usize
Expand description

Byte offset of the units-th UTF-16 code unit in s (clamped to the end, and moved forward to a char boundary if it falls inside a surrogate pair).