Module utf8

Source

Functionsยง

byte_array_from_utf8_char_array
Encode an array of Unicode codepoints (as u32) into UTF-8 bytes. (byteArrayFromUtf8CharArray in original.)
first_utf8_codepoint
Helper: decode first UTF-8 codepoint (or raw byte) returning (codepoint, byte_len).
last_utf8_codepoint
Helper: decode last UTF-8 codepoint (or raw byte) returning (codepoint, byte_len).
unicode_scalar_from_utf8
utf8_char_array_from_byte_array
Convert a UTF-8 byte slice into a vector of Unicode scalar codepoints (as i32), analogous to utf8CharArrayFromByteArray in the original code.