The UTF8CharCount() function
Returns a quick UTF-8 character count of a string.
Description
The function
has the following syntax:
inline int UTF8CharCount(const char* bytes, int length)bytes specifies the string of UTF-8 characters, which cannot be null-terminated.
length specifies the number of bytes to review.
Returns
The function returns the number of UTF-8 characters. The result might be indeterminate if bytes is not a valid UTF-8 string. Use the isValidUTF8 helper function to confirm that the string is composed of valid UTF-8 characters before you call this function to count the characters.
Throws
The function throws an opaque exception object if length < 0 or if bytes is NULL.