BloombergLP::bdlde::Utf8Util::numCharactersIfValid

Return the Unicode code-point count if string is valid UTF-8.

Synopses

Declared in <bdlde_utf8util.h>

Return the Unicode code-point count if string is valid UTF-8.

static
Utf8Util::IntPtr
numCharactersIfValid(
    char const** invalidString,
    char const* string);
» more...

Return the Unicode code-point count if string is valid UTF-8.

static
Utf8Util::IntPtr
numCharactersIfValid(
    char const** invalidString,
    char const* string,
    size_type length);
» more...

Return Value

code-point count on success, or a negative value on invalid UTF-8

Parameters

NameDescription
invalidStringif non-null, set to after the last valid code point
stringnull-terminated UTF-8 input to examine
lengthlength of string in bytes