[#BloombergLP-bdlde-CharConvertUtf32-utf32ToUtf8-09]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdlde.adoc[bdlde]::xref:BloombergLP/bdlde/CharConvertUtf32.adoc[CharConvertUtf32]::utf32ToUtf8
:relfileprefix: ../../../
:mrdocs:

`utf32ToUtf8` overloads

== Synopses

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

Convert the UTF&hyphen;32 `srcString` into UTF&hyphen;8 in `dstString`&period;


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

[.small]#xref:BloombergLP/bdlde/CharConvertUtf32/utf32ToUtf8-03d.adoc[_» more&period;&period;&period;_]#

Convert the UTF&hyphen;32 source into UTF&hyphen;8 in the destination string&period;


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

[.small]#xref:BloombergLP/bdlde/CharConvertUtf32/utf32ToUtf8-06c.adoc[_» more&period;&period;&period;_]#

Convert the UTF&hyphen;32 source into UTF&hyphen;8 in the destination string&period;


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

[.small]#xref:BloombergLP/bdlde/CharConvertUtf32/utf32ToUtf8-031.adoc[_» more&period;&period;&period;_]#

Convert the UTF&hyphen;32 `srcString` into UTF&hyphen;8 in `dstVector`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
static
int
xref:BloombergLP/bdlde/CharConvertUtf32/utf32ToUtf8-024.adoc[utf32ToUtf8](
    xref:bsl/vector-00d.adoc[bsl::vector&lt;char&gt;]* dstVector,
    unsigned int const* srcString,
    std::size&lowbar;t* numCodePointsWritten = 0,
    unsigned char errorByte = &apos;?&apos;,
    xref:BloombergLP/bdlde/ByteOrder/Enum.adoc[ByteOrder::Enum] byteOrder = ByteOrder&colon;&colon;e&lowbar;HOST);
----

[.small]#xref:BloombergLP/bdlde/CharConvertUtf32/utf32ToUtf8-024.adoc[_» more&period;&period;&period;_]#

Convert the UTF&hyphen;32 source into UTF&hyphen;8 in the destination vector&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
static
int
xref:BloombergLP/bdlde/CharConvertUtf32/utf32ToUtf8-01.adoc[utf32ToUtf8](
    std::pmr::vector&lt;char&gt;* dstVector,
    unsigned int const* srcString,
    std::size&lowbar;t* numCodePointsWritten = 0,
    unsigned char errorByte = &apos;?&apos;,
    xref:BloombergLP/bdlde/ByteOrder/Enum.adoc[ByteOrder::Enum] byteOrder = ByteOrder&colon;&colon;e&lowbar;HOST);
----

[.small]#xref:BloombergLP/bdlde/CharConvertUtf32/utf32ToUtf8-01.adoc[_» more&period;&period;&period;_]#

Convert the UTF&hyphen;32 source into UTF&hyphen;8 in the destination vector&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
static
int
xref:BloombergLP/bdlde/CharConvertUtf32/utf32ToUtf8-030.adoc[utf32ToUtf8](
    std::vector&lt;char&gt;* dstVector,
    unsigned int const* srcString,
    std::size&lowbar;t* numCodePointsWritten = 0,
    unsigned char errorByte = &apos;?&apos;,
    xref:BloombergLP/bdlde/ByteOrder/Enum.adoc[ByteOrder::Enum] byteOrder = ByteOrder&colon;&colon;e&lowbar;HOST);
----

[.small]#xref:BloombergLP/bdlde/CharConvertUtf32/utf32ToUtf8-030.adoc[_» more&period;&period;&period;_]#

Convert the UTF&hyphen;32 source of given length into UTF&hyphen;8 in `dstString`&period;


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

[.small]#xref:BloombergLP/bdlde/CharConvertUtf32/utf32ToUtf8-0c.adoc[_» more&period;&period;&period;_]#

Convert the UTF&hyphen;32 source of given length into UTF&hyphen;8 in `dstString`&period;


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

[.small]#xref:BloombergLP/bdlde/CharConvertUtf32/utf32ToUtf8-02f.adoc[_» more&period;&period;&period;_]#

Convert the UTF&hyphen;32 source of given length into UTF&hyphen;8 in `dstString`&period;


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

[.small]#xref:BloombergLP/bdlde/CharConvertUtf32/utf32ToUtf8-066.adoc[_» more&period;&period;&period;_]#

Convert the UTF&hyphen;32 source of given length into UTF&hyphen;8 in `dstVector`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
static
int
xref:BloombergLP/bdlde/CharConvertUtf32/utf32ToUtf8-0d.adoc[utf32ToUtf8](
    xref:bsl/vector-00d.adoc[bsl::vector&lt;char&gt;]* dstVector,
    unsigned int const* srcString,
    std::size&lowbar;t srcStringLength,
    std::size&lowbar;t* numCodePointsWritten = 0,
    unsigned char errorByte = &apos;?&apos;,
    xref:BloombergLP/bdlde/ByteOrder/Enum.adoc[ByteOrder::Enum] byteOrder = ByteOrder&colon;&colon;e&lowbar;HOST);
----

[.small]#xref:BloombergLP/bdlde/CharConvertUtf32/utf32ToUtf8-0d.adoc[_» more&period;&period;&period;_]#

Convert the UTF&hyphen;32 source of given length into UTF&hyphen;8 in `dstVector`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
static
int
xref:BloombergLP/bdlde/CharConvertUtf32/utf32ToUtf8-033.adoc[utf32ToUtf8](
    std::pmr::vector&lt;char&gt;* dstVector,
    unsigned int const* srcString,
    std::size&lowbar;t srcStringLength,
    std::size&lowbar;t* numCodePointsWritten = 0,
    unsigned char errorByte = &apos;?&apos;,
    xref:BloombergLP/bdlde/ByteOrder/Enum.adoc[ByteOrder::Enum] byteOrder = ByteOrder&colon;&colon;e&lowbar;HOST);
----

[.small]#xref:BloombergLP/bdlde/CharConvertUtf32/utf32ToUtf8-033.adoc[_» more&period;&period;&period;_]#

Convert the UTF&hyphen;32 source of given length into UTF&hyphen;8 in `dstVector`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
static
int
xref:BloombergLP/bdlde/CharConvertUtf32/utf32ToUtf8-07.adoc[utf32ToUtf8](
    std::vector&lt;char&gt;* dstVector,
    unsigned int const* srcString,
    std::size&lowbar;t srcStringLength,
    std::size&lowbar;t* numCodePointsWritten = 0,
    unsigned char errorByte = &apos;?&apos;,
    xref:BloombergLP/bdlde/ByteOrder/Enum.adoc[ByteOrder::Enum] byteOrder = ByteOrder&colon;&colon;e&lowbar;HOST);
----

[.small]#xref:BloombergLP/bdlde/CharConvertUtf32/utf32ToUtf8-07.adoc[_» more&period;&period;&period;_]#

Convert UTF&hyphen;32 from `srcString` into UTF&hyphen;8 in `dstBuffer`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
static
int
xref:BloombergLP/bdlde/CharConvertUtf32/utf32ToUtf8-05.adoc[utf32ToUtf8](
    char* dstBuffer,
    std::size&lowbar;t dstCapacity,
    unsigned int const* srcString,
    std::size&lowbar;t* numCodePointsWritten = 0,
    std::size&lowbar;t* numBytesWritten = 0,
    unsigned char errorByte = &apos;?&apos;,
    xref:BloombergLP/bdlde/ByteOrder/Enum.adoc[ByteOrder::Enum] byteOrder = ByteOrder&colon;&colon;e&lowbar;HOST);
----

[.small]#xref:BloombergLP/bdlde/CharConvertUtf32/utf32ToUtf8-05.adoc[_» more&period;&period;&period;_]#

Convert the UTF&hyphen;32 source of given length into UTF&hyphen;8 in `dstBuffer`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
static
int
xref:BloombergLP/bdlde/CharConvertUtf32/utf32ToUtf8-08.adoc[utf32ToUtf8](
    char* dstBuffer,
    std::size&lowbar;t dstCapacity,
    unsigned int const* srcString,
    std::size&lowbar;t srcStringLength,
    std::size&lowbar;t* numCodePointsWritten = 0,
    std::size&lowbar;t* numBytesWritten = 0,
    unsigned char errorByte = &apos;?&apos;,
    xref:BloombergLP/bdlde/ByteOrder/Enum.adoc[ByteOrder::Enum] byteOrder = ByteOrder&colon;&colon;e&lowbar;HOST);
----

[.small]#xref:BloombergLP/bdlde/CharConvertUtf32/utf32ToUtf8-08.adoc[_» more&period;&period;&period;_]#

== Return Value

* 0 on success or `CharConvertStatus&colon;&colon;k&lowbar;INVALID&lowbar;INPUT&lowbar;BIT` on invalid input
* 0 on success and a non&hyphen;zero status otherwise
* 0 on success or a bit&hyphen;wise OR of `CharConvertStatus` flags otherwise

== Parameters

[cols="1,4"]
|===
| Name| Description
| *dstString*
| destination for the UTF&hyphen;8 conversion result
| *srcString*
| null&hyphen;terminated UTF&hyphen;32 source string to convert
| *numCodePointsWritten*
| if non&hyphen;null, receives the number of UTF&hyphen;8 code points written (including terminator)
| *errorByte*
| optional substitute for invalid UTF&hyphen;32 values&semi; 0 writes nothing
| *byteOrder*
| byte order of the UTF&hyphen;32 input (host by default)
| *dstVector*
| destination for the null&hyphen;terminated UTF&hyphen;8 result
| *srcStringLength*
| number of UTF&hyphen;32 values to convert
| *dstBuffer*
| buffer for the UTF&hyphen;8 conversion result
| *dstCapacity*
| capacity of `dstBuffer` in bytes
| *numBytesWritten*
| if non&hyphen;null, receives the number of bytes written
|===


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