BloombergLP::bdlde::CharConvertUtf16::utf8ToUtf16

Load into the destination the UTF-16 conversion of the UTF-8 source.

Synopsis

Declared in <bdlde_charconvertutf16.h>

static
int
utf8ToUtf16(
    bsl::wstring* dstString,
    char const* srcString,
    std::size_t* numCodePointsWritten = 0,
    wchar_t errorWord = '?',
    ByteOrder::Enum byteOrder = ByteOrder::e_HOST);

Description

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

Return Value

0 on success and a non-zero status otherwise

Parameters

NameDescription
dstStringdestination for the converted output
srcStringsource string to convert
numCodePointsWrittenif non-null, set to the code-point count written
errorWordreplacement for invalid input, or 0 to skip
byteOrderUTF-16 byte order; host order if unspecified