From fc0dae9c819a4ee64f4610db1f005dfb841030c5 Mon Sep 17 00:00:00 2001 From: Thomas Voss Date: Tue, 9 Apr 2024 18:49:27 +0200 Subject: Move unicode/gbrk.h to unicode/string.h --- lib/unicode/string/u8glen.c | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 lib/unicode/string/u8glen.c (limited to 'lib/unicode/string/u8glen.c') diff --git a/lib/unicode/string/u8glen.c b/lib/unicode/string/u8glen.c new file mode 100644 index 0000000..394a62d --- /dev/null +++ b/lib/unicode/string/u8glen.c @@ -0,0 +1,10 @@ +#include "unicode/string.h" + +size_t +u8glen(const char8_t *s, size_t n) +{ + size_t m = 0; + while (u8gnext(nullptr, &s, &n)) + m++; + return m; +} -- cgit v1.2.3