Expand description
UTF-8 byte offset to character offset conversion utilities.
JavaScript uses UTF-16 code units for string indexing, while Rust uses bytes. This module provides functions to convert between byte offsets and character offsets for proper interoperability with JavaScript/WASM environments.
Functionsยง
- byte_
column_ to_ char_ column - Convert a byte offset to a character offset in a UTF-8 string.
- byte_
offset_ to_ char_ offset - get_
line_ content - Get the content of a specific line (1-indexed) from the full content.