BloombergLP::bdlde::CharConvertUtf16

Provide a namespace for static UTF-8/UTF-16 conversion utilities.

Synopsis

Declared in <bdlde_charconvertutf16.h>

struct CharConvertUtf16;

Description

This struct provides a namespace for a suite of static functions to convert buffers or containers between UTF-8 and UTF-16. Note that Byte Order Mark (BOM) sequences are neither generated nor recognized as special. If a BOM is present in the input, it will be translated, whether correct (0xfeff) or incorrect (0xfffe), into the output without any special handling.

Static Member Functions

NameDescription
computeRequiredUtf16Words Return the UTF-16 word count needed for the given UTF-8 input.
computeRequiredUtf8Bytes Return the UTF-8 byte count needed for the given UTF-16 input.
utf16ToUtf8 utf16ToUtf8 overloads
utf8ToUtf16 utf8ToUtf16 overloads