BloombergLP::bdlde::CharConvertUcs2::ucs2ToUtf8

ucs2ToUtf8 overloads

Synopses

Declared in <bdlde_charconvertucs2.h>

Load into result the UTF-8 conversion of the null-terminated UCS-2 srcString.

static
int
ucs2ToUtf8(
    bsl::string* result,
    unsigned short const* srcString,
    std::size_t* numCharsWritten = 0);
» more...

Load into result the UTF-8 conversion of the null-terminated UCS-2 srcString.

static
int
ucs2ToUtf8(
    std::pmr::string* result,
    unsigned short const* srcString,
    std::size_t* numCharsWritten = 0);
» more...

Load into result the UTF-8 conversion of the null-terminated UCS-2 srcString.

static
int
ucs2ToUtf8(
    std::string* result,
    unsigned short const* srcString,
    std::size_t* numCharsWritten = 0);
» more...

Convert a null-terminated UCS-2 string to UTF-8 in a fixed buffer.

static
int
ucs2ToUtf8(
    char* dstBuffer,
    std::size_t dstCapacity,
    unsigned short const* srcString,
    std::size_t* numCharsWritten = 0,
    std::size_t* numBytesWritten = 0);
» 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

NameDescription
resultoutput string for the UTF-8 conversion
srcStringnull-terminated UCS-2 input
numCharsWrittenif non-null, receives character count written
dstBufferoutput buffer for the UTF-8 conversion
dstCapacitycapacity of dstBuffer in bytes
numBytesWrittenif non-null, receives byte count written