3 .Dt GRAPHEME_IS_CHARACTER_BREAK 3
6 .Nm grapheme_is_character_break
7 .Nd test for a grapheme cluster break between two codepoints
11 .Fn grapheme_is_character_break "uint_least32_t cp1" "uint_least32_t cp2" "uint_least16_t *state"
14 .Fn grapheme_is_character_break
15 function determines if there is a grapheme cluster break (see
17 between the two codepoints
21 By specification this decision depends on a
23 that can at most be completely reset after detecting a break and must
24 be reset every time one deviates from sequential processing.
30 .Fn grapheme_is_character_break
31 behaves as if it was called with a fully reset state.
34 .Fn grapheme_is_character_break
37 if there is a grapheme cluster break between the codepoints
46 /* cc (-static) -o example example.c -lgrapheme */
55 uint_least16_t state = 0;
56 uint_least32_t s1[] = ..., s2[] = ...; /* two input arrays */
59 for (i = 0; i + 1 < sizeof(s1) / sizeof(*s1); i++) {
60 if (grapheme_is_character_break(s[i], s[i + 1], &state)) {
61 printf("break in s1 at offset %zu\n", i);
64 memset(&state, 0, sizeof(state)); /* reset state */
65 for (i = 0; i + 1 < sizeof(s2) / sizeof(*s2); i++) {
66 if (grapheme_is_character_break(s[i], s[i + 1], &state)) {
67 printf("break in s2 at offset %zu\n", i);
75 .Xr grapheme_next_character_break 3 ,
76 .Xr grapheme_next_character_break_utf8 3 ,
79 .Fn grapheme_is_character_break
80 is compliant with the Unicode ${UNICODE_VERSION} specification.
82 .An Laslo Hunhold Aq Mt dev@frign.de