folly::appendCodePointToUtf8

Encode a single Unicode code point into a UTF-8 byte sequence.

Synopsis

Declared in <folly/Unicode.h>

void
appendCodePointToUtf8(
    char32_t cp,
    std::string& out);

Description

Result is undefined if `cp' is an invalid code point.

Parameters

NameDescription
cpThe code point to encode.
outThe string that the UTF-8 bytes are appended to.