BloombergLP::bdlde::Utf8Util::getByteSize

Return the byte length of the UTF-8 code point at codePoint.

Synopsis

Declared in <bdlde_utf8util.h>

static
int
getByteSize(char const* codePoint);

Description

Return the length (in bytes) of the UTF-8-encoded code point beginning at the specified codePoint. The behavior is undefined unless codePoint is the address of the first byte of a valid UTF-8 encoded character. Note that the value returned will be in the range [1 .. 4]. Also note that 1 is returned if 0 == *codePoint since '0' is a valid 1-byte encoding.

DEPRECATED: Use numBytesInCodePoint instead.

Return Value

length in bytes of the encoded code point

Parameters

NameDescription
codePointaddress of the first byte of a valid UTF-8 code point