Module encoding

Module encoding 

Source

Modules§

char_handling_error
Error sentinels returned in-band as negative TCodepoint values, matching C++ enum CharHandlingError.

Functions§

byte_to_latin1
Convert a raw byte sequence into a Latin-1 string encoded as UTF-8.
char_to_utf8
Encode a codepoint into UTF-8 bytes.
handle_utf8_first_byte
Inspect a UTF-8 first byte.
hex_char_to_int
Convert a hex digit (0-9, a-f, A-F) to its value, or -1 if not a hex digit. Faithful to C++ HexCharToInt.
latin1_to_bytes
Convert a Latin-1 string (given as bytes that are themselves valid UTF-8) into the raw Latin-1 byte sequence.
parse_next_utf8
Decode the first codepoint from a UTF-8 byte slice.
parse_utf8
Decode every codepoint in a UTF-8 byte slice.

Type Aliases§

TCodepoint
A Unicode codepoint, matching C++ TCodepoint = int32_t.