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

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

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

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

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

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

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

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

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

Name

Description

dstVector

destination for the UTF‐32 conversion result

srcString

UTF‐8 source string view to convert

errorWord

optional substitute for invalid encodings; 0 ignores them

byteOrder

byte order of the UTF‐32 output (host by default)

dstBuffer

buffer for the UTF‐32 conversion result

dstCapacity

capacity of dstBuffer in words

numCodePointsWritten

if non‐null, receives the number of code points written (including the terminator)

Created with MrDocs