std1.0.0-beta-7 SafeC docs

std :: encoding::utf8

Function std::utf8_len

#include <std/encoding/utf8.h> source ยท definition

unsigned long utf8_len(const &char s)

Counts codepoints (not bytes) in a NUL-terminated, well-formed UTF-8 string. Returns 0 if the string is not valid UTF-8 (use utf8_is_valid first if you need to distinguish that from a genuinely empty string).