BloombergLP::bdlde::CharConvertUtf16

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.

Synopsis

Declared in <bdlde_charconvertutf16.h>

struct CharConvertUtf16;

Static Member Functions

NameDescription
computeRequiredUtf16Words Return the number of words required to store the translation of the specified UTF-8 string srcBuffer into a 0 terminated UTF-16 string (including the 0 terminating word into the returned count). Optionally specify endPtr, referring to one past the last input character. If endPtr is not supplied, or is 0, treat srcBuffer as 0 terminated. Note that this function will return the size utf8ToUtf16 will require, assuming the errorWord argument to utf8ToUtf16 is non-zero.
computeRequiredUtf8Bytes computeRequiredUtf8Bytes overloads
utf16ToUtf8 utf16ToUtf8 overloads
utf8ToUtf16 utf8ToUtf16 overloads