commit f408f92ae137a0d00746a7ef617be65e90f0c4e8
parent f66cceeb8db6b0c6ef88079467cf1c66042e3042
Author: Santtu Lakkala <inz@inz.fi>
Date: Mon, 8 Jan 2024 18:19:49 +0200
Port to libgrapheme 2
Diffstat:
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/components/battery.c b/components/battery.c
@@ -88,13 +88,13 @@
int i = 0;
for (p = 0; str[p]; p += l, i++)
- l = grapheme_next_character_break(str + p, SIZE_MAX);
+ l = grapheme_next_character_break_utf8(str + p, SIZE_MAX);
i = i * perc / 101;
for (p = 0; i--; p += l)
- l = grapheme_next_character_break(str + p, SIZE_MAX);
- l = grapheme_next_character_break(str + p, SIZE_MAX);
+ l = grapheme_next_character_break_utf8(str + p, SIZE_MAX);
+ l = grapheme_next_character_break_utf8(str + p, SIZE_MAX);
return bprintf("%.*s", (int)l, str + p);
}