BloombergLP::bdlde::Utf8Util::numCharacters

Return the Unicode code-point count in string.

Synopsis

Declared in <bdlde_utf8util.h>

static
Utf8Util::IntPtr
numCharacters(char const* string);

Description

Return the number of Unicode code points in the specified string. string is necessarily null-terminated, so it cannot contain embedded null bytes. The behavior is undefined unless string contains valid UTF-8. Note that string may contain less than bsl::strlen(string) Unicode code points.

DEPRECATED: Use numCodePointsRaw instead.

Return Value

number of Unicode code points in string

Parameters

NameDescription
stringnull-terminated valid UTF-8 input