[#BloombergLP-bdlde-CharConvertUcs2-ucs2ToUtf8-00] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdlde.adoc[bdlde]::xref:BloombergLP/bdlde/CharConvertUcs2.adoc[CharConvertUcs2]::ucs2ToUtf8 :relfileprefix: ../../../ :mrdocs: `ucs2ToUtf8` overloads == Synopses Declared in `<bdlde_charconvertucs2.h>` Load into `result` the UTF‐8 conversion of the null‐terminated UCS‐2 `srcString`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- static int xref:BloombergLP/bdlde/CharConvertUcs2/ucs2ToUtf8-01.adoc[ucs2ToUtf8]( xref:bsl/string.adoc[bsl::string]* result, unsigned short const* srcString, std::size_t* numCharsWritten = 0); ---- [.small]#xref:BloombergLP/bdlde/CharConvertUcs2/ucs2ToUtf8-01.adoc[_» more..._]# Load into `result` the UTF‐8 conversion of the null‐terminated UCS‐2 `srcString`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- static int xref:BloombergLP/bdlde/CharConvertUcs2/ucs2ToUtf8-0b.adoc[ucs2ToUtf8]( std::pmr::string* result, unsigned short const* srcString, std::size_t* numCharsWritten = 0); ---- [.small]#xref:BloombergLP/bdlde/CharConvertUcs2/ucs2ToUtf8-0b.adoc[_» more..._]# Load into `result` the UTF‐8 conversion of the null‐terminated UCS‐2 `srcString`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- static int xref:BloombergLP/bdlde/CharConvertUcs2/ucs2ToUtf8-06.adoc[ucs2ToUtf8]( std::string* result, unsigned short const* srcString, std::size_t* numCharsWritten = 0); ---- [.small]#xref:BloombergLP/bdlde/CharConvertUcs2/ucs2ToUtf8-06.adoc[_» more..._]# Convert a null‐terminated UCS‐2 string to UTF‐8 in a fixed buffer. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- static int xref:BloombergLP/bdlde/CharConvertUcs2/ucs2ToUtf8-03.adoc[ucs2ToUtf8]( char* dstBuffer, std::size_t dstCapacity, unsigned short const* srcString, std::size_t* numCharsWritten = 0, std::size_t* numBytesWritten = 0); ---- [.small]#xref:BloombergLP/bdlde/CharConvertUcs2/ucs2ToUtf8-03.adoc[_» more..._]# == Return Value * 0 on success and `CharConvertStatus::k_INVALID_INPUT_BIT` otherwise * 0 on success and a non‐zero status otherwise * 0 on success and a bitwise‐or of the masks specified by `CharConvertStatus::Enum` otherwise == Parameters [cols="1,4"] |=== | Name| Description | *result* | output string for the UTF‐8 conversion | *srcString* | null‐terminated UCS‐2 input | *numCharsWritten* | if non‐null, receives character count written | *dstBuffer* | output buffer for the UTF‐8 conversion | *dstCapacity* | capacity of `dstBuffer` in bytes | *numBytesWritten* | if non‐null, receives byte count written |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#