C4 Engine
C4 Engine API Documentation

Text::GetUnicodeCharCount

Defined in:  TSText.h
Returns the number of UTF-8 characters in a string.
Prototype

int32 GetUnicodeCharCount(const char *text);

Parameters
text A pointer to a null-terminated character string.
Description
The GetUnicodeCharCount function returns the number of individual characters encoded as UTF-8 in the string specified by the text parameter. This number is at most the number of bytes occupied by the string, but it is less for strings containing multi-byte characters. Each character is counted as one unit regardless of the number of bytes it occupies.

The string must be null-terminated by a zero byte. The null terminator is not included in the length.
See Also

Text::GetTextLength