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.

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

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.

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

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.

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

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.

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

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.

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

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.

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

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.

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

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.

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

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.

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

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.

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

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.

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

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.

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

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.

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

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.

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

Created with MrDocs