[#BloombergLP-bdlde-CharConvertUtf16-utf16ToUtf8-00e]
= 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;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
static
int
utf16ToUtf8(
    std::vector&lt;char&gt;* dstVector,
    unsigned short const* srcString,
    std::size&lowbar;t srcLengthInWords,
    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);
----

== Description

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;

== Return Value

0 on success and a non&hyphen;zero status otherwise

== Parameters

[cols="1,4"]
|===
| Name| Description
| *dstVector*
| destination for the converted output
| *srcString*
| source string to convert
| *srcLengthInWords*
| number of UTF&hyphen;16 words in `srcString`
| *numCodePointsWritten*
| if non&hyphen;null, set to the code&hyphen;point count written
| *errorByte*
| replacement for invalid input, or 0 to skip
| *byteOrder*
| UTF&hyphen;16 byte order&semi; host order if unspecified
|===


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