Skip to main content

Crate simd_utf16_len

Crate simd_utf16_len 

Source
Expand description

SIMD-accelerated UTF-16 length calculation from UTF-8 bytes.

Formula: utf16_len = byte_length - continuation_bytes + four_byte_leaders

Where:

  • continuation bytes: (byte & 0xC0) == 0x80
  • four-byte leaders: byte >= 0xF0

Functionsยง

utf16_len
Compute the number of UTF-16 code units for UTF-8 string.