BloombergLP::bdlde::CharConvertUcs2::ucs2ToUtf8

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

Synopsis

Declared in <bdlde_charconvertucs2.h>

static
int
ucs2ToUtf8(
    std::string* result,
    unsigned short const* srcString,
    std::size_t* numCharsWritten = 0);

Description

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

Return Value

0 on success and a non-zero status otherwise

Parameters

NameDescription
resultoutput string for the UTF-8 conversion
srcStringnull-terminated UCS-2 input
numCharsWrittenif non-null, receives character count written