[#BloombergLP-bdlde-CharConvertUtf16-utf16ToUtf8-059]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdlde.adoc[bdlde]::xref:BloombergLP/bdlde/CharConvertUtf16.adoc[CharConvertUtf16]::utf16ToUtf8
:relfileprefix: ../../../
:mrdocs:

Load into the destination the UTF&hyphen;8 conversion of the UTF&hyphen;16 source&period; Return 0 on success and a non&hyphen;zero status otherwise&period; See the first `utf16ToUtf8` overload in this group for full contract details&period;

== Synopsis

Declared in `&lt;bdlde&lowbar;charconvertutf16&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
static
int
utf16ToUtf8(
    xref:bsl/string.adoc[bsl::string]* dstString,
    std::wstring&lowbar;view const& srcString,
    std::size&lowbar;t* numCodePointsWritten = 0,
    char errorByte = &apos;?&apos;,
    xref:BloombergLP/bdlde/ByteOrder/Enum.adoc[ByteOrder::Enum] byteOrder = ByteOrder&colon;&colon;e&lowbar;HOST);
----


[.small]#Created with https://www.mrdocs.com[MrDocs]#
