BloombergLP::bdlde::CharConvertUtf32::utf32ToUtf8

utf32ToUtf8 overloads

Synopses

Declared in <bdlde_charconvertutf32.h>

Convert the UTF-32 srcString into UTF-8 in dstString.

static
int
utf32ToUtf8(
    bsl::string* dstString,
    unsigned int const* srcString,
    std::size_t* numCodePointsWritten = 0,
    unsigned char errorByte = '?',
    ByteOrder::Enum byteOrder = ByteOrder::e_HOST);
» more...

Convert the UTF-32 source into UTF-8 in the destination string.

static
int
utf32ToUtf8(
    std::pmr::string* dstString,
    unsigned int const* srcString,
    std::size_t* numCodePointsWritten = 0,
    unsigned char errorByte = '?',
    ByteOrder::Enum byteOrder = ByteOrder::e_HOST);
» more...

Convert the UTF-32 source into UTF-8 in the destination string.

static
int
utf32ToUtf8(
    std::string* dstString,
    unsigned int const* srcString,
    std::size_t* numCodePointsWritten = 0,
    unsigned char errorByte = '?',
    ByteOrder::Enum byteOrder = ByteOrder::e_HOST);
» more...

Convert the UTF-32 srcString into UTF-8 in dstVector.

static
int
utf32ToUtf8(
    bsl::vector<char>* dstVector,
    unsigned int const* srcString,
    std::size_t* numCodePointsWritten = 0,
    unsigned char errorByte = '?',
    ByteOrder::Enum byteOrder = ByteOrder::e_HOST);
» more...

Convert the UTF-32 source into UTF-8 in the destination vector.

static
int
utf32ToUtf8(
    std::pmr::vector<char>* dstVector,
    unsigned int const* srcString,
    std::size_t* numCodePointsWritten = 0,
    unsigned char errorByte = '?',
    ByteOrder::Enum byteOrder = ByteOrder::e_HOST);
» more...

Convert the UTF-32 source into UTF-8 in the destination vector.

static
int
utf32ToUtf8(
    std::vector<char>* dstVector,
    unsigned int const* srcString,
    std::size_t* numCodePointsWritten = 0,
    unsigned char errorByte = '?',
    ByteOrder::Enum byteOrder = ByteOrder::e_HOST);
» more...

Convert the UTF-32 source of given length into UTF-8 in dstString.

static
int
utf32ToUtf8(
    bsl::string* dstString,
    unsigned int const* srcString,
    std::size_t srcStringLength,
    std::size_t* numCodePointsWritten = 0,
    unsigned char errorByte = '?',
    ByteOrder::Enum byteOrder = ByteOrder::e_HOST);
» more...

Convert the UTF-32 source of given length into UTF-8 in dstString.

static
int
utf32ToUtf8(
    std::pmr::string* dstString,
    unsigned int const* srcString,
    std::size_t srcStringLength,
    std::size_t* numCodePointsWritten = 0,
    unsigned char errorByte = '?',
    ByteOrder::Enum byteOrder = ByteOrder::e_HOST);
» more...

Convert the UTF-32 source of given length into UTF-8 in dstString.

static
int
utf32ToUtf8(
    std::string* dstString,
    unsigned int const* srcString,
    std::size_t srcStringLength,
    std::size_t* numCodePointsWritten = 0,
    unsigned char errorByte = '?',
    ByteOrder::Enum byteOrder = ByteOrder::e_HOST);
» more...

Convert the UTF-32 source of given length into UTF-8 in dstVector.

static
int
utf32ToUtf8(
    bsl::vector<char>* dstVector,
    unsigned int const* srcString,
    std::size_t srcStringLength,
    std::size_t* numCodePointsWritten = 0,
    unsigned char errorByte = '?',
    ByteOrder::Enum byteOrder = ByteOrder::e_HOST);
» more...

Convert the UTF-32 source of given length into UTF-8 in dstVector.

static
int
utf32ToUtf8(
    std::pmr::vector<char>* dstVector,
    unsigned int const* srcString,
    std::size_t srcStringLength,
    std::size_t* numCodePointsWritten = 0,
    unsigned char errorByte = '?',
    ByteOrder::Enum byteOrder = ByteOrder::e_HOST);
» more...

Convert the UTF-32 source of given length into UTF-8 in dstVector.

static
int
utf32ToUtf8(
    std::vector<char>* dstVector,
    unsigned int const* srcString,
    std::size_t srcStringLength,
    std::size_t* numCodePointsWritten = 0,
    unsigned char errorByte = '?',
    ByteOrder::Enum byteOrder = ByteOrder::e_HOST);
» more...

Convert UTF-32 from srcString into UTF-8 in dstBuffer.

static
int
utf32ToUtf8(
    char* dstBuffer,
    std::size_t dstCapacity,
    unsigned int const* srcString,
    std::size_t* numCodePointsWritten = 0,
    std::size_t* numBytesWritten = 0,
    unsigned char errorByte = '?',
    ByteOrder::Enum byteOrder = ByteOrder::e_HOST);
» more...

Convert the UTF-32 source of given length into UTF-8 in dstBuffer.

static
int
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 = '?',
    ByteOrder::Enum byteOrder = ByteOrder::e_HOST);
» more...

Return Value

  • 0 on success or CharConvertStatus::k_INVALID_INPUT_BIT on invalid input
  • 0 on success and a non-zero status otherwise
  • 0 on success or a bit-wise OR of CharConvertStatus flags otherwise

Parameters

NameDescription
dstStringdestination for the UTF-8 conversion result
srcStringnull-terminated UTF-32 source string to convert
numCodePointsWrittenif non-null, receives the number of UTF-8 code points written (including terminator)
errorByteoptional substitute for invalid UTF-32 values; 0 writes nothing
byteOrderbyte order of the UTF-32 input (host by default)
dstVectordestination for the null-terminated UTF-8 result
srcStringLengthnumber of UTF-32 values to convert
dstBufferbuffer for the UTF-8 conversion result
dstCapacitycapacity of dstBuffer in bytes
numBytesWrittenif non-null, receives the number of bytes written