[#BloombergLP-bdlde-CharConvertUtf16-utf8ToUtf16-014] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdlde.adoc[bdlde]::xref:BloombergLP/bdlde/CharConvertUtf16.adoc[CharConvertUtf16]::utf8ToUtf16 :relfileprefix: ../../../ :mrdocs: `utf8ToUtf16` overloads == Synopses Declared in `<bdlde_charconvertutf16.h>` Load into the destination the UTF‐16 conversion of the UTF‐8 source. Return 0 on success and a non‐zero status otherwise. See the overload taking `bsl::wstring` for full contract details. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- static int xref:BloombergLP/bdlde/CharConvertUtf16/utf8ToUtf16-06.adoc[utf8ToUtf16]( xref:bsl/u16string.adoc[bsl::u16string]* dstString, std::string_view const& srcString, std::size_t* numCodePointsWritten = 0, char16_t errorChar = '?', xref:BloombergLP/bdlde/ByteOrder/Enum.adoc[ByteOrder::Enum] byteOrder = ByteOrder::e_HOST); ---- [.small]#xref:BloombergLP/bdlde/CharConvertUtf16/utf8ToUtf16-06.adoc[_» more..._]# Load into the destination the UTF‐16 conversion of the UTF‐8 source. Return 0 on success and a non‐zero status otherwise. See the overload taking `bsl::wstring` for full contract details. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- static int xref:BloombergLP/bdlde/CharConvertUtf16/utf8ToUtf16-0101.adoc[utf8ToUtf16]( xref:bsl/u16string.adoc[bsl::u16string]* dstString, char const* srcString, std::size_t* numCodePointsWritten = 0, char16_t errorChar = '?', xref:BloombergLP/bdlde/ByteOrder/Enum.adoc[ByteOrder::Enum] byteOrder = ByteOrder::e_HOST); ---- [.small]#xref:BloombergLP/bdlde/CharConvertUtf16/utf8ToUtf16-0101.adoc[_» more..._]# Load into the destination the UTF‐16 conversion of the UTF‐8 source. Return 0 on success and a non‐zero status otherwise. See the overload taking `bsl::wstring` for full contract details. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- static int xref:BloombergLP/bdlde/CharConvertUtf16/utf8ToUtf16-09.adoc[utf8ToUtf16]( std::pmr::u16string* dstString, std::string_view const& srcString, std::size_t* numCodePointsWritten = 0, char16_t errorChar = '?', xref:BloombergLP/bdlde/ByteOrder/Enum.adoc[ByteOrder::Enum] byteOrder = ByteOrder::e_HOST); ---- [.small]#xref:BloombergLP/bdlde/CharConvertUtf16/utf8ToUtf16-09.adoc[_» more..._]# Load into the destination the UTF‐16 conversion of the UTF‐8 source. Return 0 on success and a non‐zero status otherwise. See the overload taking `bsl::wstring` for full contract details. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- static int xref:BloombergLP/bdlde/CharConvertUtf16/utf8ToUtf16-0106.adoc[utf8ToUtf16]( std::pmr::u16string* dstString, char const* srcString, std::size_t* numCodePointsWritten = 0, char16_t errorChar = '?', xref:BloombergLP/bdlde/ByteOrder/Enum.adoc[ByteOrder::Enum] byteOrder = ByteOrder::e_HOST); ---- [.small]#xref:BloombergLP/bdlde/CharConvertUtf16/utf8ToUtf16-0106.adoc[_» more..._]# Load into the destination the UTF‐16 conversion of the UTF‐8 source. Return 0 on success and a non‐zero status otherwise. See the overload taking `bsl::wstring` for full contract details. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- static int xref:BloombergLP/bdlde/CharConvertUtf16/utf8ToUtf16-0e5.adoc[utf8ToUtf16]( std::u16string* dstString, std::string_view const& srcString, std::size_t* numCodePointsWritten = 0, char16_t errorChar = '?', xref:BloombergLP/bdlde/ByteOrder/Enum.adoc[ByteOrder::Enum] byteOrder = ByteOrder::e_HOST); ---- [.small]#xref:BloombergLP/bdlde/CharConvertUtf16/utf8ToUtf16-0e5.adoc[_» more..._]# Load into the destination the UTF‐16 conversion of the UTF‐8 source. Return 0 on success and a non‐zero status otherwise. See the overload taking `bsl::wstring` for full contract details. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- static int xref:BloombergLP/bdlde/CharConvertUtf16/utf8ToUtf16-0dc8.adoc[utf8ToUtf16]( std::u16string* dstString, char const* srcString, std::size_t* numCodePointsWritten = 0, char16_t errorChar = '?', xref:BloombergLP/bdlde/ByteOrder/Enum.adoc[ByteOrder::Enum] byteOrder = ByteOrder::e_HOST); ---- [.small]#xref:BloombergLP/bdlde/CharConvertUtf16/utf8ToUtf16-0dc8.adoc[_» more..._]# that UTF‐16 can validly encode (in the range `[ 1 .. 0xd7ff ]` or `[ 0xe000 .. 0x10ffff ]`). If `errorChar` is 0, invalid input code points are ignored (i.e., produce no corresponding output). The behavior is undefined unless `srcString` is null‐terminated when specified as a `const char *`. Note that one code point can occupy multiple UTF‐16 words, and that if `srcString` is a `bslstl::StringRef`, it may contain embedded null bytes that will be translated to null words embedded in the output. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- static int xref:BloombergLP/bdlde/CharConvertUtf16/utf8ToUtf16-04.adoc[utf8ToUtf16]( xref:bsl/wstring.adoc[bsl::wstring]* dstString, std::string_view const& srcString, std::size_t* numCodePointsWritten = 0, wchar_t errorWord = '?', xref:BloombergLP/bdlde/ByteOrder/Enum.adoc[ByteOrder::Enum] byteOrder = ByteOrder::e_HOST); ---- [.small]#xref:BloombergLP/bdlde/CharConvertUtf16/utf8ToUtf16-04.adoc[_» more..._]# Load into the destination the UTF‐16 conversion of the UTF‐8 source. Return 0 on success and a non‐zero status otherwise. See the overload taking `bsl::wstring` for full contract details. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- static int xref:BloombergLP/bdlde/CharConvertUtf16/utf8ToUtf16-0dca.adoc[utf8ToUtf16]( xref:bsl/wstring.adoc[bsl::wstring]* dstString, char const* srcString, std::size_t* numCodePointsWritten = 0, wchar_t errorWord = '?', xref:BloombergLP/bdlde/ByteOrder/Enum.adoc[ByteOrder::Enum] byteOrder = ByteOrder::e_HOST); ---- [.small]#xref:BloombergLP/bdlde/CharConvertUtf16/utf8ToUtf16-0dca.adoc[_» more..._]# Load into the destination the UTF‐16 conversion of the UTF‐8 source. Return 0 on success and a non‐zero status otherwise. See the overload taking `bsl::wstring` for full contract details. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- static int xref:BloombergLP/bdlde/CharConvertUtf16/utf8ToUtf16-083.adoc[utf8ToUtf16]( std::pmr::wstring* dstString, std::string_view const& srcString, std::size_t* numCodePointsWritten = 0, wchar_t errorWord = '?', xref:BloombergLP/bdlde/ByteOrder/Enum.adoc[ByteOrder::Enum] byteOrder = ByteOrder::e_HOST); ---- [.small]#xref:BloombergLP/bdlde/CharConvertUtf16/utf8ToUtf16-083.adoc[_» more..._]# Load into the destination the UTF‐16 conversion of the UTF‐8 source. Return 0 on success and a non‐zero status otherwise. See the overload taking `bsl::wstring` for full contract details. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- static int xref:BloombergLP/bdlde/CharConvertUtf16/utf8ToUtf16-0f.adoc[utf8ToUtf16]( std::pmr::wstring* dstString, char const* srcString, std::size_t* numCodePointsWritten = 0, wchar_t errorWord = '?', xref:BloombergLP/bdlde/ByteOrder/Enum.adoc[ByteOrder::Enum] byteOrder = ByteOrder::e_HOST); ---- [.small]#xref:BloombergLP/bdlde/CharConvertUtf16/utf8ToUtf16-0f.adoc[_» more..._]# Load into the destination the UTF‐16 conversion of the UTF‐8 source. Return 0 on success and a non‐zero status otherwise. See the overload taking `bsl::wstring` for full contract details. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- static int xref:BloombergLP/bdlde/CharConvertUtf16/utf8ToUtf16-0e3.adoc[utf8ToUtf16]( std::wstring* dstString, std::string_view const& srcString, std::size_t* numCodePointsWritten = 0, wchar_t errorWord = '?', xref:BloombergLP/bdlde/ByteOrder/Enum.adoc[ByteOrder::Enum] byteOrder = ByteOrder::e_HOST); ---- [.small]#xref:BloombergLP/bdlde/CharConvertUtf16/utf8ToUtf16-0e3.adoc[_» more..._]# Load into the destination the UTF‐16 conversion of the UTF‐8 source. Return 0 on success and a non‐zero status otherwise. See the overload taking `bsl::wstring` for full contract details. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- static int xref:BloombergLP/bdlde/CharConvertUtf16/utf8ToUtf16-0b2.adoc[utf8ToUtf16]( std::wstring* dstString, char const* srcString, std::size_t* numCodePointsWritten = 0, wchar_t errorWord = '?', xref:BloombergLP/bdlde/ByteOrder/Enum.adoc[ByteOrder::Enum] byteOrder = ByteOrder::e_HOST); ---- [.small]#xref:BloombergLP/bdlde/CharConvertUtf16/utf8ToUtf16-0b2.adoc[_» more..._]# Load into the specified `dstVector` the result of converting the specified UTF‐8 `srcString` to its UTF‐16 equivalent. Optionally specify `numCodePointsWritten`, which (if not 0) indicates the location of the modifiable variable into which the number of UTF‐16 code points (including the null terminator) written is to be loaded. Optionally specify an `errorWord` to be substituted (if not 0) for invalid encodings in the input string. Invalid encodings are multi‐byte encoding parts out of sequence, non‐minimal UTF‐8 encodings, or code points outside the ranges that UTF‐16 can validly encode (in the range `[ 1 .. 0xd7ff ]` or `[ 0xe000 .. 0x10ffff ]`). If `errorWord` is 0, invalid input is ignored (i.e., produces no corresponding output). Optionally specify `byteOrder` to indicate the byte order of the UTF‐16 output; if `byteOrder` is not specified, the output is assumed to be in host byte order. Any previous contents of the destination are discarded. Return 0 on success and `CharConvertStatus::k_INVALID_INPUT_BIT` otherwise. The behavior is undefined unless `errorWord` is either 0 or a valid single‐word encoded UTF‐16 code point (in the range `[ 1 .. 0xd7ff ]` or `[ 0xe000 .. 0xffff ]`) and `srcString` is null‐terminated when specified as a `const char *`. Note that one code point can occupy multiple 16‐bit words. Also note that the size of the result vector is always fitted to the null‐terminated result, including the terminating 0. Also note that if `srcString` is a `bslstl::StringRef`, it may contain embedded null bytes that will be translated to null words embedded in the output. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- static int xref:BloombergLP/bdlde/CharConvertUtf16/utf8ToUtf16-0b9.adoc[utf8ToUtf16]( xref:bsl/vector-00d.adoc[bsl::vector<unsigned short>]* dstVector, std::string_view const& srcString, std::size_t* numCodePointsWritten = 0, unsigned short errorWord = '?', xref:BloombergLP/bdlde/ByteOrder/Enum.adoc[ByteOrder::Enum] byteOrder = ByteOrder::e_HOST); ---- [.small]#xref:BloombergLP/bdlde/CharConvertUtf16/utf8ToUtf16-0b9.adoc[_» more..._]# Load into the destination the UTF‐16 conversion of the UTF‐8 source. Return 0 on success and a non‐zero status otherwise. See the overload taking `bsl::wstring` for full contract details. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- static int xref:BloombergLP/bdlde/CharConvertUtf16/utf8ToUtf16-00.adoc[utf8ToUtf16]( xref:bsl/vector-00d.adoc[bsl::vector<unsigned short>]* dstVector, char const* srcString, std::size_t* numCodePointsWritten = 0, unsigned short errorWord = '?', xref:BloombergLP/bdlde/ByteOrder/Enum.adoc[ByteOrder::Enum] byteOrder = ByteOrder::e_HOST); ---- [.small]#xref:BloombergLP/bdlde/CharConvertUtf16/utf8ToUtf16-00.adoc[_» more..._]# Load into the destination the UTF‐16 conversion of the UTF‐8 source. Return 0 on success and a non‐zero status otherwise. See the overload taking `bsl::wstring` for full contract details. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- static int xref:BloombergLP/bdlde/CharConvertUtf16/utf8ToUtf16-0cf.adoc[utf8ToUtf16]( std::pmr::vector<unsigned short>* dstVector, std::string_view const& srcString, std::size_t* numCodePointsWritten = 0, unsigned short errorWord = '?', xref:BloombergLP/bdlde/ByteOrder/Enum.adoc[ByteOrder::Enum] byteOrder = ByteOrder::e_HOST); ---- [.small]#xref:BloombergLP/bdlde/CharConvertUtf16/utf8ToUtf16-0cf.adoc[_» more..._]# Load into the destination the UTF‐16 conversion of the UTF‐8 source. Return 0 on success and a non‐zero status otherwise. See the overload taking `bsl::wstring` for full contract details. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- static int xref:BloombergLP/bdlde/CharConvertUtf16/utf8ToUtf16-087.adoc[utf8ToUtf16]( std::pmr::vector<unsigned short>* dstVector, char const* srcString, std::size_t* numCodePointsWritten = 0, unsigned short errorWord = '?', xref:BloombergLP/bdlde/ByteOrder/Enum.adoc[ByteOrder::Enum] byteOrder = ByteOrder::e_HOST); ---- [.small]#xref:BloombergLP/bdlde/CharConvertUtf16/utf8ToUtf16-087.adoc[_» more..._]# Load into the destination the UTF‐16 conversion of the UTF‐8 source. Return 0 on success and a non‐zero status otherwise. See the overload taking `bsl::wstring` for full contract details. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- static int xref:BloombergLP/bdlde/CharConvertUtf16/utf8ToUtf16-019.adoc[utf8ToUtf16]( std::vector<unsigned short>* dstVector, std::string_view const& srcString, std::size_t* numCodePointsWritten = 0, unsigned short errorWord = '?', xref:BloombergLP/bdlde/ByteOrder/Enum.adoc[ByteOrder::Enum] byteOrder = ByteOrder::e_HOST); ---- [.small]#xref:BloombergLP/bdlde/CharConvertUtf16/utf8ToUtf16-019.adoc[_» more..._]# Load into the destination the UTF‐16 conversion of the UTF‐8 source. Return 0 on success and a non‐zero status otherwise. See the overload taking `bsl::wstring` for full contract details. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- static int xref:BloombergLP/bdlde/CharConvertUtf16/utf8ToUtf16-071.adoc[utf8ToUtf16]( std::vector<unsigned short>* dstVector, char const* srcString, std::size_t* numCodePointsWritten = 0, unsigned short errorWord = '?', xref:BloombergLP/bdlde/ByteOrder/Enum.adoc[ByteOrder::Enum] byteOrder = ByteOrder::e_HOST); ---- [.small]#xref:BloombergLP/bdlde/CharConvertUtf16/utf8ToUtf16-071.adoc[_» more..._]# Load into the specified `dstBuffer` of the specified `dstCapacity`, the result of converting the specified UTF‐8 `srcString` to its UTF‐16 equivalent. Optionally specify `numCodePointsWritten`, which (if not 0) indicates the location of the variable into which the number of UTF‐16 code points (including the terminating 0) written is to be loaded. Optionally specify `numWordsWritten`, which (if not 0) indicates the location of the modifiable variable into which the number of `short` _memory words_ written (including the null terminator) is to be loaded. Optionally specify an `errorWord` to be substituted (if not 0) for invalid encodings in the input string. Invalid encodings are multi‐byte encoding parts out of sequence, non‐minimal UTF‐8 encodings of code points, or code points outside the ranges that UTF‐16 can validly encode (in the range `[ 1 .. 0xd7ff ]` or `[ 0xde00 .. 0x10ffff ]`). Optionally specify `byteOrder` to indicate the byte order of the UTF‐16 output; if `byteOrder` is not specified, the output is assumed to be in host byte order. If `errorWord` is 0, invalid input sequences are ignored (i.e., produce no corresponding output). Return 0 on success and a bit‐wise or of the bits specified by `CharConvertStatus::Enum` otherwise to indicate that there were invalid sequences or if `dstCapacity` was inadequate to store the output. If `dstCapacity > 0` yet `dstCapacity` specifies a buffer too small to hold the output, the maximal null‐terminated prefix of the properly converted result string is loaded into `dstBuffer`. The behavior is undefined unless `dstBuffer`, if specified, refers to an array of at least `dstCapacity` elements, `errorWord` is either 0 or a valid single‐word encoded UTF‐16 code point (in the range `[ 1 .. 0xd7ff ]` or `[ 0xe000 .. 0xffff ]`), and `srcString` is null‐terminated if supplied as a `const char *`. Note that if `dstCapacity` is 0, `*dstBuffer` is not modified and this function returns a value with `CharConvertStatus::k_OUT_OF_SPACE_BIT` set and 0 is written into `*numCodePointsWritten` and `*numWordsWritten` (if those pointers are non‐null), since there is insufficient space for even a null terminator alone. Also note that one code point can occupy multiple 16‐bit words, so that `*numWordsWritten` may be greater than `*numCodePointsWritten`, and therefore that an input `srcString` of `dstCapacity` code points may not fit into `dstBuffer`. However, an input `srcString` of `dstCapacity` bytes (including terminating 0, if present) will always fit (since the UTF‐8 encoding of a code point requires at least as many bytes as the UTF‐16 encoding requires words). Also note that if `srcString` is a `bslstl::StringRef`, it may contain embedded null bytes that will be translated to null words embedded in the output. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- static int xref:BloombergLP/bdlde/CharConvertUtf16/utf8ToUtf16-079.adoc[utf8ToUtf16]( char16_t* dstBuffer, std::size_t dstCapacity, std::string_view const& srcString, std::size_t* numCodePointsWritten = 0, std::size_t* numWordsWritten = 0, char16_t errorChar = '?', xref:BloombergLP/bdlde/ByteOrder/Enum.adoc[ByteOrder::Enum] byteOrder = ByteOrder::e_HOST); ---- [.small]#xref:BloombergLP/bdlde/CharConvertUtf16/utf8ToUtf16-079.adoc[_» more..._]# Load into the destination the UTF‐16 conversion of the UTF‐8 source. Return 0 on success and a non‐zero status otherwise. See the overload taking `bsl::wstring` for full contract details. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- static int xref:BloombergLP/bdlde/CharConvertUtf16/utf8ToUtf16-07a.adoc[utf8ToUtf16]( char16_t* dstBuffer, std::size_t dstCapacity, char const* srcString, std::size_t* numCodePointsWritten = 0, std::size_t* numWordsWritten = 0, char16_t errorChar = '?', xref:BloombergLP/bdlde/ByteOrder/Enum.adoc[ByteOrder::Enum] byteOrder = ByteOrder::e_HOST); ---- [.small]#xref:BloombergLP/bdlde/CharConvertUtf16/utf8ToUtf16-07a.adoc[_» more..._]# Load into the specified `dstBuffer` of the specified `dstCapacity`, the result of converting the specified UTF‐8 `srcString` to its UTF‐16 equivalent. Optionally specify `numCodePointsWritten`, which (if not 0) indicates the location of the variable into which the number of UTF‐16 code points (including the null terminator) written is to be loaded. Optionally specify `numWordsWritten`, which (if not 0) indicates the location of the modifiable variable into which the number of `short` _memory words_ written (including the null terminator) is to be loaded. Optionally specify an `errorWord` to be substituted (if not 0) for invalid encodings in the input string. Invalid encodings are multi‐byte encoding parts out of sequence, non‐minimal UTF‐8 encodings of code points, or code points outside the ranges that UTF‐16 can validly encode (in the range `[ 1 .. 0xd7ff ]` or `[ 0xe000 .. 0x10ffff ]`). If `errorWord` is 0, invalid input sequences are ignored (i.e., produce no corresponding output). Optionally specify `byteOrder` to indicate the byte order of the UTF‐16 output; if `byteOrder` is not specified, the output is assumed to be in host byte order. Return 0 on success and a bit‐wise or of the bits specified by `CharConvertStatus::Enum` otherwise to indicate that there were invalid input sequences or if `dstCapacity` was inadequate to store the output. If `dstCapacity > 0` yet `dstCapacity` specifies a buffer too small to hold the output, the maximal null‐terminated prefix of the properly converted result string is loaded into `dstBuffer`. The behavior is undefined unless `dstBuffer` refers to an array of at least `dstCapacity` elements, `errorWord` is either 0 or a valid single‐word encoded UTF‐16 code point (in the range `[ 1 .. 0xd7ff ]` or `[ 0xe000 .. 0xffff ]`), and `srcString` is null‐terminated when supplied as a `const char *`. Note that if `dstCapacity` is 0, `*dstBuffer` is not modified and this function returns a value with `CharConvertStatus::k_OUT_OF_SPACE_BIT` set and 0 is written into `*numCodePointsWritten` and `*numWordsWritten` (if those pointers are non‐null), since there is insufficient space for even a null terminator alone. Also note that one code point can occupy multiple 16‐bit _words_, so that `*numWordsWritten` may be greater than `*numCodePointsWritten`, and therefore that an input `srcString` of `dstCapacity` code points may not fit into `dstBuffer`, however, an input `srcString` of `dstCapacity` bytes (including null terminator, if present) will always fit (since the UTF‐8 encoding of a code point requires at least as many bytes as the UTF‐16 encoding requires words). Also note that if `srcString` is a `bslstl::StringRef`, it may contain embedded null bytes that will be translated to null words embedded in the output. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- static int xref:BloombergLP/bdlde/CharConvertUtf16/utf8ToUtf16-0ec.adoc[utf8ToUtf16]( unsigned short* dstBuffer, std::size_t dstCapacity, std::string_view const& srcString, std::size_t* numCodePointsWritten = 0, std::size_t* numWordsWritten = 0, unsigned short errorWord = '?', xref:BloombergLP/bdlde/ByteOrder/Enum.adoc[ByteOrder::Enum] byteOrder = ByteOrder::e_HOST); ---- [.small]#xref:BloombergLP/bdlde/CharConvertUtf16/utf8ToUtf16-0ec.adoc[_» more..._]# Load into the destination the UTF‐16 conversion of the UTF‐8 source. Return 0 on success and a non‐zero status otherwise. See the overload taking `bsl::wstring` for full contract details. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- static int xref:BloombergLP/bdlde/CharConvertUtf16/utf8ToUtf16-0c1.adoc[utf8ToUtf16]( unsigned short* dstBuffer, std::size_t dstCapacity, char const* srcString, std::size_t* numCodePointsWritten = 0, std::size_t* numWordsWritten = 0, unsigned short errorWord = '?', xref:BloombergLP/bdlde/ByteOrder/Enum.adoc[ByteOrder::Enum] byteOrder = ByteOrder::e_HOST); ---- [.small]#xref:BloombergLP/bdlde/CharConvertUtf16/utf8ToUtf16-0c1.adoc[_» more..._]# Load into the destination the UTF‐16 conversion of the UTF‐8 source. Return 0 on success and a non‐zero status otherwise. See the overload taking `bsl::wstring` for full contract details. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- static int xref:BloombergLP/bdlde/CharConvertUtf16/utf8ToUtf16-0e4.adoc[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 = '?', xref:BloombergLP/bdlde/ByteOrder/Enum.adoc[ByteOrder::Enum] byteOrder = ByteOrder::e_HOST); ---- [.small]#xref:BloombergLP/bdlde/CharConvertUtf16/utf8ToUtf16-0e4.adoc[_» more..._]# Load into the destination the UTF‐16 conversion of the UTF‐8 source. Return 0 on success and a non‐zero status otherwise. See the overload taking `bsl::wstring` for full contract details. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- static int xref:BloombergLP/bdlde/CharConvertUtf16/utf8ToUtf16-05.adoc[utf8ToUtf16]( wchar_t* dstBuffer, std::size_t dstCapacity, char const* srcString, std::size_t* numCodePointsWritten = 0, std::size_t* numWordsWritten = 0, wchar_t errorWord = '?', xref:BloombergLP/bdlde/ByteOrder/Enum.adoc[ByteOrder::Enum] byteOrder = ByteOrder::e_HOST); ---- [.small]#xref:BloombergLP/bdlde/CharConvertUtf16/utf8ToUtf16-05.adoc[_» more..._]# [.small]#Created with https://www.mrdocs.com[MrDocs]#