Skip to main content

Module latin1

Module latin1 

Source
Expand description

Methods for normalizing Latin1 input into a UTF-16 sink.

NFC is not available, since Latin1 input is already known to be in NFC.

Constantsยง

NFD_BITS ๐Ÿ”’
NFKC_BITS ๐Ÿ”’
NFKD_BITS ๐Ÿ”’

Staticsยง

COMPATIBILITY_DECOMPOSITIONS ๐Ÿ”’
Table containing the compatibility decompositions.
TABLE ๐Ÿ”’
Entries start from U+00A0 NO-BREAK SPACE. If the character is always its own normalization, the value in the table is 0. If the character has a compatibility decompositons, the value in the table is the index into COMPATIBILITY_DECOMPOSITIONS shifted left by two and the length of the subslice of COMPATIBILITY_DECOMPOSITIONS in the low 2 bits. This means that the high half is zero. Otherwise, the high 8 bits are the first character of the canonical decomposition and the low 8 bits are the offset that needs to be added to U+0300 to get the second character of the canonical decomposition.

Functionsยง

compatibility_decomposition ๐Ÿ”’
Writes the compatibility decomposition of c to sink.
normalize_nfd_to
Normalize Latin1 text to NFD UTF-16 written to sink.
normalize_nfkc_to
Normalize Latin1 text to NFKC UTF-16 written to sink.
normalize_nfkd_to
Normalize Latin1 text to NFKD UTF-16 written to sink.
split_normalized_nfd
Split Latin1 text into (head, tail) such that the first byte of tail is the first byte of input that is not in NFD. If text is fully in NFD, tail is empty.
split_normalized_nfkc
Split Latin1 text into (head, tail) such that the first byte of tail is the first byte of input that is not in NFKC. If text is fully in NFKC, tail is empty.
split_normalized_nfkd
Split Latin1 text into (head, tail) such that the first byte of tail is the first byte of input that is not in NFKD. If text is fully in NFKD, tail is empty.