BloombergLP::bdlde::Utf8Util::numCharactersRaw

Return the Unicode code-point count in a bounded string.

Synopsis

Declared in <bdlde_utf8util.h>

static
Utf8Util::IntPtr
numCharactersRaw(
    char const* string,
    size_type length);

Description

Return the number of Unicode code points in the specified string having the specified length (in bytes). string need not be null-terminated and can contain embedded null bytes, and string may be null if 0 == length (see {Empty Input Strings}). The behavior is undefined string contains valid UTF-8. Note that string may contain less than length Unicode code points.

DEPRECATED: Use numCodePointsRaw instead.

Return Value

number of Unicode code points in string

Parameters

NameDescription
stringUTF-8 byte sequence (need not be null-terminated)
lengthlength of string in bytes