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

Name

Description

p

Reference to the read cursor; advanced past the decoded bytes.

e

Pointer to the end of the byte sequence.

skipOnError

Whether to skip invalid bytes instead of throwing.

Created with MrDocs