Return the UTF-16 word count needed for the given UTF-8 input.
Declared in <bdlde_charconvertutf16.h>
static
std::size_t
computeRequiredUtf16Words(
char const* srcBuffer,
char const* endPtr = 0);
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.
the number of UTF-16 words required, including the terminating 0
| Name | Description |
|---|---|
| srcBuffer | source buffer to measure |
| endPtr | one past the last input character, or 0 if null-terminated |