GRAPHEME_NEXT_CHARACTER_BREAK(3)
π NAME π
Hiii bestie! π This page lives in the Library Functions Manual, and the header title is GRAPHEME_NEXT_CHARACTER_(3). Today we're talking about grapheme_next_character_break() β your little helper for finding the next grapheme cluster break. π«Ά
grapheme_next_character_breakβ determine the codepoint-offset to the next grapheme cluster break β¨π
π¦ SYNOPSIS π¦
Okay, formal fit check time:
#include <grapheme.h>
size_t
grapheme_next_character_break(const uint_least32_t *str, size_t len);
β¨ DESCRIPTION β¨
Okay so here's the tea: grapheme_next_character_break() computes the offset (in codepoints) to the next grapheme cluster break β peep libgrapheme(7) if you wanna know more β inside the codepoint array str of length len. If a grapheme cluster begins right at str, that offset is literally equal to the length of said grapheme cluster. π
Now, if len is set to SIZE_MAX (stdint.h is already included by grapheme.h, no extra homework), then str is interpreted as NUL-terminated, and processing stops when it encounters a codepoint with the value 0. π
For UTF-8-encoded input data, bestie, you can use grapheme_next_character_break_utf8(3) instead. That's the sibling function. π¦
π RETURN VALUES π
grapheme_next_character_break() returns the offset (in codepoints) to the next grapheme cluster break in str, or 0 if str is NULL. That's the whole return vibe check. π
π SEE ALSO π
Go give these a look, iykyk:
β STANDARDS β
grapheme_next_character_break() is compliant with the Unicode 17.0.0 specification. Standards? Ate. β
π AUTHORS π
Shoutout to Laslo Hunhold <dev@frign.de> for this one. π
Cute little sign-off: this page's source/version is suckless.org, and it's dated 2022-10-06. The page title is GRAPHEME_NEXT_CHARACTER_BREAK(3). Mwah π
π¦ where this page comes from
- nixos 26.05: libgrapheme 3.0.0
- nixpkgs unstable: libgrapheme 3.0.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms