Module utf

Source
Expand description

UTF-8 Encoding & Decoding

Using info from: here

Functionsยง

encode_be_utf8_char
Encodes the character into the provided buffer using UTF-8. A subslice of the provided buffer is returned providing the amount of buffer actually used.
read_be_utf8_char
Reads 1, 2, 3, or 4 bytes representing the unicode UTF-8 formatted character from the specified input. Returns the character read and the number of bytes consumed.
required_utf8_bytes
Returns the number of required bytes to store the specified character in UTF-8.
write_be_utf8_char
Writes 1, 2, 3, or 4 bytes representing the unicode UTF-8 format character to the specified output. Upon success, returns the number of bytes written.