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

Synopsis

Declared in <bdlde_charconvertutf32.h>

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

Description

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.

Return Value

0 on success and a non‐zero status otherwise

Parameters

Name

Description

dstBuffer

buffer for the UTF‐8 conversion result

dstCapacity

capacity of dstBuffer in bytes

srcString

UTF‐32 source buffer to convert

srcStringLength

number of UTF‐32 values to convert

numCodePointsWritten

if non‐null, receives the number of UTF‐8 code points written

numBytesWritten

if non‐null, receives the number of bytes written

errorByte

optional substitute for invalid UTF‐32 values; 0 writes nothing

byteOrder

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

Created with MrDocs