folly::utf8ToCodePoint

Decode a single Unicode code point from UTF-8 byte sequence.

Synopsis

Declared in <folly/Unicode.h>

char32_t
utf8ToCodePoint(
    unsigned char const*& p,
    unsigned char const const* e,
    bool skipOnError);

Return Value

The decoded Unicode code point.

Parameters

NameDescription
pReference to the read cursor; advanced past the decoded bytes.
ePointer to the end of the byte sequence.
skipOnErrorWhether to skip invalid bytes instead of throwing.