Skip to main content

utf16_line_col_to_offset

Function utf16_line_col_to_offset 

Source
pub fn utf16_line_col_to_offset(text: &str, line: u32, col: u32) -> usize
Expand description

Converts (line, column_utf16) coordinates into a byte offset.

If the provided line or column is out of bounds, the result is clamped to the nearest valid byte position in text.