FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    utf8_index_to_utf16

    function · ferroui-base · v0.5.0

    fn utf8_index_to_utf16(text: &str, utf8_index: usize) -> usize
    

    Converts a UTF-8 byte offset into text to the UTF-16 code unit index of the same position. An offset inside a character maps to the start of that character; an offset past the end maps to the UTF-16 length.

    View source

    Availability

    Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.