Load into the destination the UTF-16 conversion of the UTF-8 source.
Declared in <bdlde_charconvertutf16.h>
static
int
utf8ToUtf16(
wchar_t* dstBuffer,
std::size_t dstCapacity,
std::string_view const& srcString,
std::size_t* numCodePointsWritten = 0,
std::size_t* numWordsWritten = 0,
wchar_t errorWord = '?',
ByteOrder::Enum byteOrder = ByteOrder::e_HOST);
Return 0 on success and a non-zero status otherwise. See the overload taking bsl::wstring for full contract details.
0 on success and a non-zero status otherwise
| Name | Description |
|---|---|
| dstBuffer | destination buffer for the converted output |
| dstCapacity | capacity of dstBuffer in elements |
| srcString | source string to convert |
| numCodePointsWritten | if non-null, set to the code-point count written |
| numWordsWritten | if non-null, set to the word count written |
| errorWord | replacement for invalid input, or 0 to skip |
| byteOrder | UTF-16 byte order; host order if unspecified |