BloombergLP::bdlde::CharConvertUtf32::utf8ToUtf32

utf8ToUtf32 overloads

Synopses

Declared in <bdlde_charconvertutf32.h>

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

static
int
utf8ToUtf32(
    bsl::vector<unsigned int>* dstVector,
    std::string_view const& srcString,
    unsigned int errorWord = '?',
    ByteOrder::Enum byteOrder = ByteOrder::e_HOST);
» more...

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

static
int
utf8ToUtf32(
    bsl::vector<unsigned int>* dstVector,
    char const* srcString,
    unsigned int errorWord = '?',
    ByteOrder::Enum byteOrder = ByteOrder::e_HOST);
» more...

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

static
int
utf8ToUtf32(
    std::pmr::vector<unsigned int>* dstVector,
    std::string_view const& srcString,
    unsigned int errorWord = '?',
    ByteOrder::Enum byteOrder = ByteOrder::e_HOST);
» more...

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

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

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

static
int
utf8ToUtf32(
    std::vector<unsigned int>* dstVector,
    std::string_view const& srcString,
    unsigned int errorWord = '?',
    ByteOrder::Enum byteOrder = ByteOrder::e_HOST);
» more...

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

static
int
utf8ToUtf32(
    std::vector<unsigned int>* dstVector,
    char const* srcString,
    unsigned int errorWord = '?',
    ByteOrder::Enum byteOrder = ByteOrder::e_HOST);
» more...

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

static
int
utf8ToUtf32(
    unsigned int* dstBuffer,
    std::size_t dstCapacity,
    std::string_view const& srcString,
    std::size_t* numCodePointsWritten = 0,
    unsigned int errorWord = '?',
    ByteOrder::Enum byteOrder = ByteOrder::e_HOST);
» more...

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

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

Return Value

  • 0 on success and a non-zero status otherwise
  • 0 on success and CharConvertStatus::k_INVALID_INPUT_BIT otherwise
  • 0 on success and a bit-wise OR of CharConvertStatus::Enum masks otherwise

Parameters

NameDescription
dstVectordestination for the UTF-32 conversion result
srcStringUTF-8 source string view to convert
errorWordoptional substitute for invalid encodings; 0 ignores them
byteOrderbyte order of the UTF-32 output (host by default)
dstBufferbuffer for the UTF-32 conversion result
dstCapacitycapacity of dstBuffer in words
numCodePointsWrittenif non-null, receives the number of code points written (including the terminator)