RUNENORM(2) RUNENORM(2) NAME runedecomp, runerecomp, runenorm, utfnorm, fullrunenorm, fullutfnorm, runegbreak, runewbreak - multi-rune graphemes SYNOPSIS #include #include void runedecomp(Rune dst[2], Rune src) Rune runerecomp(Rune r[2]) int runenorm(Rune *dst, Rune *src, int max, int compose) int utfnorm(char *dst, char *src, int max, int compose) Rune* fullrunenorm(Rune *s, int n) char* fullutfnorm(char *s, int n) Rune* runegbreak(Rune *r) Rune* runewbreak(Rune *r) DESCRIPTION These routines help in handling graphemes that may span mul- tiple runes. Runedecomp decomposes the rune src and places the two decom- posed runes into dst. If no decomposition is found dst is zeroed. Runerecomp composes the two runes provided in r and returns the result. If no composition is found 0 is returned. Runenorm (Utfnorm) copies the rune (UTF) sequence src to dst while performing Unicode normalization. No more then max runes (bytes) will be copied, and the result is always null terminated. If compose is non-zero NFC normalization is per- formed, otherwise NFD normalization is performed. Fullrunenorm (fullutfnorm) determines if enough runes (bytes) are present in s to perform normalization. If enough is present, a pointer is returned to the first rune (byte) that begins the next context, otherwise s is returned. No more then n runes (bytes) will be read. Runegbreak (Runewbreak) searches r for the next grapheme (word) break opportunity. If none are found before the end of the string r is returned. SOURCE /sys/src/libc/port/mkrunetype.c /sys/src/libc/port/runenorm.c /sys/src/libc/port/runebreak.c SEE ALSO UnicodeĀ® Standard Annex #15 UnicodeĀ® Standard Annex #29 rune(2), utf(6), tcs(1)