micro-utils/include/mu_strlen.h

14 lines
157 B
C
Raw Normal View History

2024-07-01 10:23:00 +00:00
#ifndef _UTF8_STRLEN
#define _UTF8_STRLEN
2024-07-06 11:31:29 +00:00
size_t mu_strlen(const char *s) {
2024-07-01 10:23:00 +00:00
size_t i = 0;
while (*s++)
i += (*s & 0xC0) != 0x80;
return i;
}
#endif