Synopsis

PDX_MSGT unl_UTF16Length(const UNL_CHAR16 *str, const UNL_CHAR16 *const end, size_t *const utf8_size, size_t *const utf16_size, size_t *const utf32_size)

Purpose

Computes the sizes for UTF-8, UTF-16, and UTF-32 sequences for the length of a UTF-16 string.

Description

Computes the sizes, how much memory is needed minus the null terminator, for UTF-8, UTF-16, and UTF-32 sequences for the length of a UTF-16 string.

Input

start

Start of UTF16 string to be processed.

end

If not NULL then this address is the end of the string else the end of the string is the first NULL character. Processing occurs from start until just before the end.

Output

utf8_size

Size, in bytes, needed for a UTF-8 string.

utf16_size

Size, in bytes, needed for a UTF-16 string. Always a multiple of 2.

utf32_size

Size, in bytes, needed for a UTF-32 string. Always a multiple of 4. This is also 4 times the number of codepoints.

Return

      UNL_NOERR
      No Error
      UNL_CONVERSION_ERR
      Low level error return
      .fi