BloombergLP::bdlde::CharConvertUtf16::computeRequiredUtf8Bytes

Return the UTF-8 byte count needed for the given UTF-16 input.

Synopses

Declared in <bdlde_charconvertutf16.h>

Return the UTF-8 byte count needed for the given UTF-16 input.

static
std::size_t
computeRequiredUtf8Bytes(
    char16_t const* srcBuffer,
    char16_t const* endPtr = 0,
    ByteOrder::Enum byteOrder = ByteOrder::e_HOST);
» more...

Return the UTF-8 byte count needed for the given UTF-16 input.

static
std::size_t
computeRequiredUtf8Bytes(
    unsigned short const* srcBuffer,
    unsigned short const* endPtr = 0,
    ByteOrder::Enum byteOrder = ByteOrder::e_HOST);
» more...

Return the UTF-8 byte count needed for the given UTF-16 input.

static
std::size_t
computeRequiredUtf8Bytes(
    wchar_t const* srcBuffer,
    wchar_t const* endPtr = 0,
    ByteOrder::Enum byteOrder = ByteOrder::e_HOST);
» more...

Return Value

the number of UTF-8 bytes required, including the terminating 0

Parameters

NameDescription
srcBuffersource buffer to measure
endPtrone past the last input character, or 0 if null-terminated
byteOrderUTF-16 byte order; host order if unspecified