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);

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);

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);

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);

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

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

Created with MrDocs