Computes the length of a string, up to the specified length.
#include <utf8.h> size_t utf8nlen ( const utf8_t *string size_t nbytes);
(IN) Points to the string whose length is to be computed.
(IN) Specifies the maximum number of bytes to scan.
Returns the number of characters (not bytes) in a UTF-8 string, not including the null terminating character, or nbytes if no null termination character is found in the specified nbytes. If the string is longer that nbytes, the function ignores those bytes.
The utf8nlen function accepts a null-terminated, potential UTF-8 string in the current code page and measures it up to either the null terminating character or nbytes, which every occurs first.