[#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 `<bdlde_charconvertutf32.h>` Load into the specified `dstString` the result of converting the specified `srcString` of `UTF‐32` values to `UTF‐8` and return 0 on success or `CharConvertStatus::k_INVALID_INPUT_BIT` if invalid `UTF‐32` values (in the range `[0xD800 .. 0xDFFF]` or above 0x10FFFF) are encountered. Optionally specify `srcStringlength` as the number of `UTF‐32` values to be converted. If `srcStringLength` is specified, convert that many UTF‐32 values from `srcString` (including zero values), otherwise convert values up to but not including a terminating zero value. Optionally specify `numCodePointsWritten` to receive the number of `UTF‐8` code points written to `dstString`, including the null‐terminator. Optionally specify `errorByte` as the character to be written to `dstString` as the translation of invalid `UTF‐32` values; if not specified, `?` is used, and if given as 0, no character is written at all. Optionally specify `byteOrder` to determine how `UTF‐32` values in `srcString` are interpreted; if not given, host byte order is used. The behavior is undefined if `errorByte` is 0x80 or above. Note that if you are passing the `bsl::vector<unsigned int>` obtained from a call to `utf8ToUtf32` and using `srcStringLength`, you must take care to pass `vector.size() ‐ 1` to `srcStringLength` to avoid embedding the terminating 0. [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_t* numCodePointsWritten = 0, unsigned char errorByte = '?', xref:BloombergLP/bdlde/ByteOrder/Enum.adoc[ByteOrder::Enum] byteOrder = ByteOrder::e_HOST); ---- [.small]#xref:BloombergLP/bdlde/CharConvertUtf32/utf32ToUtf8-03d.adoc[_» more..._]# Load into the destination the UTF‐8 conversion of the UTF‐32 source. Return 0 on success and a non‐zero status otherwise. See the first `utf32ToUtf8` overload in this group for full contract details. [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_t* numCodePointsWritten = 0, unsigned char errorByte = '?', xref:BloombergLP/bdlde/ByteOrder/Enum.adoc[ByteOrder::Enum] byteOrder = ByteOrder::e_HOST); ---- [.small]#xref:BloombergLP/bdlde/CharConvertUtf32/utf32ToUtf8-06c.adoc[_» more..._]# Load into the destination the UTF‐8 conversion of the UTF‐32 source. Return 0 on success and a non‐zero status otherwise. See the first `utf32ToUtf8` overload in this group for full contract details. [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_t* numCodePointsWritten = 0, unsigned char errorByte = '?', xref:BloombergLP/bdlde/ByteOrder/Enum.adoc[ByteOrder::Enum] byteOrder = ByteOrder::e_HOST); ---- [.small]#xref:BloombergLP/bdlde/CharConvertUtf32/utf32ToUtf8-031.adoc[_» more..._]# Load into the specified `dstVector` the result of converting the specified `srcString` of `UTF‐32` values to `UTF‐8`, always followed by a null character, and return 0 on success or `CharConvertStatus::k_INVALID_INPUT_BIT` if invalid `UTF‐32` values (in the range `[0xD800 .. 0xDFFF]` or above 0x10FFFF) are seen. Optionally specify `srcStringlength` as the number of `UTF‐32` values to be converted. If `srcStringLength` is specified, convert that many UTF‐32 values from `srcString` (including zero values), otherwise convert values up to but not including a terminating zero value. Optionally specify `numCodePointsWritten` to receive the number of `UTF‐8` code points written to `dstVector`. Optionally specify `errorByte` as the character to be written to `dstVector` as the translation of invalid `UTF‐32` values; if not specified, `?` is used, and if given as 0, no character is written at all. Optionally specify `byteOrder` to determine how `UTF‐32` values in `srcString` are interpreted; if not given, host byte order is used. The behavior is undefined if `errorByte` is 0x80 or above. Note that if you are passing the `bsl::vector<unsigned int>` obtained from a call to `utf8ToUtf32` and using `srcStringLength`, you must take care to pass `vector.size() ‐ 1` to `srcStringLength` to avoid embedding the terminating 0. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- static int xref:BloombergLP/bdlde/CharConvertUtf32/utf32ToUtf8-024.adoc[utf32ToUtf8]( xref:bsl/vector-00d.adoc[bsl::vector<char>]* dstVector, unsigned int const* srcString, std::size_t* numCodePointsWritten = 0, unsigned char errorByte = '?', xref:BloombergLP/bdlde/ByteOrder/Enum.adoc[ByteOrder::Enum] byteOrder = ByteOrder::e_HOST); ---- [.small]#xref:BloombergLP/bdlde/CharConvertUtf32/utf32ToUtf8-024.adoc[_» more..._]# Load into the destination the UTF‐8 conversion of the UTF‐32 source. Return 0 on success and a non‐zero status otherwise. See the first `utf32ToUtf8` overload in this group for full contract details. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- static int xref:BloombergLP/bdlde/CharConvertUtf32/utf32ToUtf8-01.adoc[utf32ToUtf8]( std::pmr::vector<char>* dstVector, unsigned int const* srcString, std::size_t* numCodePointsWritten = 0, unsigned char errorByte = '?', xref:BloombergLP/bdlde/ByteOrder/Enum.adoc[ByteOrder::Enum] byteOrder = ByteOrder::e_HOST); ---- [.small]#xref:BloombergLP/bdlde/CharConvertUtf32/utf32ToUtf8-01.adoc[_» more..._]# Load into the destination the UTF‐8 conversion of the UTF‐32 source. Return 0 on success and a non‐zero status otherwise. See the first `utf32ToUtf8` overload in this group for full contract details. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- static int xref:BloombergLP/bdlde/CharConvertUtf32/utf32ToUtf8-030.adoc[utf32ToUtf8]( std::vector<char>* dstVector, unsigned int const* srcString, std::size_t* numCodePointsWritten = 0, unsigned char errorByte = '?', xref:BloombergLP/bdlde/ByteOrder/Enum.adoc[ByteOrder::Enum] byteOrder = ByteOrder::e_HOST); ---- [.small]#xref:BloombergLP/bdlde/CharConvertUtf32/utf32ToUtf8-030.adoc[_» more..._]# Load into the destination the UTF‐8 conversion of the UTF‐32 source. Return 0 on success and a non‐zero status otherwise. See the first `utf32ToUtf8` overload in this group for full contract details. [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_t srcStringLength, std::size_t* numCodePointsWritten = 0, unsigned char errorByte = '?', xref:BloombergLP/bdlde/ByteOrder/Enum.adoc[ByteOrder::Enum] byteOrder = ByteOrder::e_HOST); ---- [.small]#xref:BloombergLP/bdlde/CharConvertUtf32/utf32ToUtf8-0c.adoc[_» more..._]# Load into the destination the UTF‐8 conversion of the UTF‐32 source. Return 0 on success and a non‐zero status otherwise. See the first `utf32ToUtf8` overload in this group for full contract details. [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_t srcStringLength, std::size_t* numCodePointsWritten = 0, unsigned char errorByte = '?', xref:BloombergLP/bdlde/ByteOrder/Enum.adoc[ByteOrder::Enum] byteOrder = ByteOrder::e_HOST); ---- [.small]#xref:BloombergLP/bdlde/CharConvertUtf32/utf32ToUtf8-02f.adoc[_» more..._]# Load into the destination the UTF‐8 conversion of the UTF‐32 source. Return 0 on success and a non‐zero status otherwise. See the first `utf32ToUtf8` overload in this group for full contract details. [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_t srcStringLength, std::size_t* numCodePointsWritten = 0, unsigned char errorByte = '?', xref:BloombergLP/bdlde/ByteOrder/Enum.adoc[ByteOrder::Enum] byteOrder = ByteOrder::e_HOST); ---- [.small]#xref:BloombergLP/bdlde/CharConvertUtf32/utf32ToUtf8-066.adoc[_» more..._]# Load into the destination the UTF‐8 conversion of the UTF‐32 source. Return 0 on success and a non‐zero status otherwise. See the first `utf32ToUtf8` overload in this group for full contract details. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- static int xref:BloombergLP/bdlde/CharConvertUtf32/utf32ToUtf8-0d.adoc[utf32ToUtf8]( xref:bsl/vector-00d.adoc[bsl::vector<char>]* dstVector, unsigned int const* srcString, std::size_t srcStringLength, std::size_t* numCodePointsWritten = 0, unsigned char errorByte = '?', xref:BloombergLP/bdlde/ByteOrder/Enum.adoc[ByteOrder::Enum] byteOrder = ByteOrder::e_HOST); ---- [.small]#xref:BloombergLP/bdlde/CharConvertUtf32/utf32ToUtf8-0d.adoc[_» more..._]# Load into the destination the UTF‐8 conversion of the UTF‐32 source. Return 0 on success and a non‐zero status otherwise. See the first `utf32ToUtf8` overload in this group for full contract details. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- static int xref:BloombergLP/bdlde/CharConvertUtf32/utf32ToUtf8-033.adoc[utf32ToUtf8]( std::pmr::vector<char>* dstVector, unsigned int const* srcString, std::size_t srcStringLength, std::size_t* numCodePointsWritten = 0, unsigned char errorByte = '?', xref:BloombergLP/bdlde/ByteOrder/Enum.adoc[ByteOrder::Enum] byteOrder = ByteOrder::e_HOST); ---- [.small]#xref:BloombergLP/bdlde/CharConvertUtf32/utf32ToUtf8-033.adoc[_» more..._]# Load into the destination the UTF‐8 conversion of the UTF‐32 source. Return 0 on success and a non‐zero status otherwise. See the first `utf32ToUtf8` overload in this group for full contract details. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- static int xref:BloombergLP/bdlde/CharConvertUtf32/utf32ToUtf8-07.adoc[utf32ToUtf8]( std::vector<char>* dstVector, unsigned int const* srcString, std::size_t srcStringLength, std::size_t* numCodePointsWritten = 0, unsigned char errorByte = '?', xref:BloombergLP/bdlde/ByteOrder/Enum.adoc[ByteOrder::Enum] byteOrder = ByteOrder::e_HOST); ---- [.small]#xref:BloombergLP/bdlde/CharConvertUtf32/utf32ToUtf8-07.adoc[_» more..._]# Unless `dstCapacity == 0`, load into the specified `dstBuffer` all or as many complete `UTF‐8` sequences converted from the specified `srcString` of UTF‐32 as will fit, along with an always‐present terminating null byte, into the specified `dstCapacity` bytes, and return 0 on success or a bit‐wise OR of `CharConvertStatus::k_INVALID_INPUT_BIT` if invalid `UTF‐32` values (in the range `[0xD800 .. 0xDFFF]` or above 0x10FFFF) are seen and `CharConvertStatus::k_OUT_OF_SPACE_BIT` if there is insufficient room for the entire result to be written. If `dstCapacity == 0` return `CharConvertStatus::k_INVALID_OUT_OF_SPACE_BIT` without modifying `dstBuffer`. Optionally specify `srcStringlength` as the number of `UTF‐32` values to be converted. If `srcStringLength` is specified, convert that many UTF‐32 values from `srcString` (including zero values), otherwise convert values up to but not including a terminating zero value. Optionally specify `numCodePointsWritten` to receive the number of `UTF‐8` code points written to `dstBuffer`. Optionally specify `numBytesWritten` to receive the number of bytes written to `dstBuffer`. Optionally specify `errorByte` as the character to be written to `dstBuffer` as the translation of invalid `UTF‐32` values; if not specified, `?` is used, and if given as 0, no character is written at all. Optionally specify `byteOrder` to determine how `UTF‐32` values in `srcString` are interpreted; if not given, host byte order is used. The behavior is undefined if `errorByte` is 0x80 or above. Note that if you are passing the `bsl::vector<unsigned int>` obtained from a call to `utf8ToUtf32` and using `srcStringLength`, you must take care to pass `vector.size() ‐ 1` to `srcStringLength` to avoid embedding the terminating 0. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- static int xref:BloombergLP/bdlde/CharConvertUtf32/utf32ToUtf8-05.adoc[utf32ToUtf8]( char* dstBuffer, std::size_t dstCapacity, unsigned int const* srcString, std::size_t* numCodePointsWritten = 0, std::size_t* numBytesWritten = 0, unsigned char errorByte = '?', xref:BloombergLP/bdlde/ByteOrder/Enum.adoc[ByteOrder::Enum] byteOrder = ByteOrder::e_HOST); ---- [.small]#xref:BloombergLP/bdlde/CharConvertUtf32/utf32ToUtf8-05.adoc[_» more..._]# Load into the destination the UTF‐8 conversion of the UTF‐32 source. Return 0 on success and a non‐zero status otherwise. See the first `utf32ToUtf8` overload in this group for full contract details. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- static int xref:BloombergLP/bdlde/CharConvertUtf32/utf32ToUtf8-08.adoc[utf32ToUtf8]( char* dstBuffer, std::size_t dstCapacity, unsigned int const* srcString, std::size_t srcStringLength, std::size_t* numCodePointsWritten = 0, std::size_t* numBytesWritten = 0, unsigned char errorByte = '?', xref:BloombergLP/bdlde/ByteOrder/Enum.adoc[ByteOrder::Enum] byteOrder = ByteOrder::e_HOST); ---- [.small]#xref:BloombergLP/bdlde/CharConvertUtf32/utf32ToUtf8-08.adoc[_» more..._]# [.small]#Created with https://www.mrdocs.com[MrDocs]#