BloombergLP::bdlde::CharConvertUtf32::utf8ToUtf32

Convert the UTF-8 source into UTF-32 in the destination vector.

Synopsis

Declared in <bdlde_charconvertutf32.h>

static
int
utf8ToUtf32(
    std::vector<unsigned int>* dstVector,
    char const* srcString,
    unsigned int errorWord = '?',
    ByteOrder::Enum byteOrder = ByteOrder::e_HOST);

Description

Load into the destination the UTF-32 conversion of the UTF-8 source. Return 0 on success and a non-zero status otherwise. See the first utf8ToUtf32 overload in this group for full contract details.

Return Value

0 on success and a non-zero status otherwise

Parameters

NameDescription
dstVectordestination for the UTF-32 conversion result
srcStringnull-terminated UTF-8 source string to convert
errorWordoptional substitute for invalid encodings; 0 ignores them
byteOrderbyte order of the UTF-32 output (host by default)