BloombergLP::bdlde::CharConvertUcs2::utf8ToUcs2

Load into result the UCS-2 conversion of the null-terminated UTF-8 srcString.

Synopsis

Declared in <bdlde_charconvertucs2.h>

static
int
utf8ToUcs2(
    std::vector<unsigned short>* result,
    char const* srcString,
    unsigned short errorCharacter = '?');

Description

Return 0 on success and a non-zero status otherwise. See the bsl::vector overload of utf8ToUcs2 for full contract details.

Return Value

0 on success and a non-zero status otherwise

Parameters

NameDescription
resultoutput vector for the UCS-2 conversion
srcStringnull-terminated UTF-8 input
errorCharactersubstitute for invalid input; 0 skips them