uconv_u16tou32(3C) Standard C Library Functions uconv_u16tou32(3C)
NAME
uconv_u16tou32, uconv_u16tou8, uconv_u32tou16, uconv_u32tou8, uconv_u8tou16, uconv_u8tou32 - Unicode encoding conversion functions
SYNOPSIS
#include <sys/types.h>
#include <sys/errno.h>
#include <sys/u8_textprep.h>
int uconv_u16tou32(const uint16_t *utf16str, size_t *utf16len,
uint32_t *utf32str, size_t *utf32len, int flag);
int uconv_u16tou8(const uint16_t *utf16str, size_t *utf16len,
uchar_t *utf8str, size_t *utf8len, int flag);
int uconv_u32tou16(const uint32_t *utf32str, size_t *utf32len,
uint16_t *utf16str, size_t *utf16len, int flag);
int uconv_u32tou8(const uint32_t *utf32str, size_t *utf32len,
uchar_t *utf8str, size_t *utf8len, int flag);
int uconv_u8tou16(const uchar_t *utf8str, size_t *utf8len,
uint16_t *utf16str, size_t *utf16len, int flag);
int uconv_u8tou32(const uchar_t *utf8str, size_t *utf8len,
uint32_t *utf32str, size_t *utf32len, int flag);
PARAMETERS
utf16str A pointer to a UTF-16 character string.
utf16len As an input parameter, the number of 16-bit unsigned integers in utf16str as UTF-16 characters to be converted or saved.
As an output parameter, the number of 16-bit unsigned integers in utf16str consumed or saved during conversion.
utf32str A pointer to a UTF-32 character string.
utf32len As an input parameter, the number of 32-bit unsigned integers in utf32str as UTF-32 characters to be converted or saved.
As an output parameter, the number of 32-bit unsigned integers in utf32str consumed or saved during conversion.
utf8str A pointer to a UTF-8 character string.
utf8len As an input parameter, the number of bytes in utf8str as UTF-8 characters to be converted or saved.
As an output parameter, the number of bytes in utf8str consumed or saved during conversion.
flag The possible conversion options that are constructed by a bitwise-inclusive-OR of the following values:
UCONV_IN_BIG_ENDIAN
The input parameter is in big endian byte ordering.
UCONV_OUT_BIG_ENDIAN
The output parameter should be in big endian byte ordering.
UCONV_IN_SYSTEM_ENDIAN
The input parameter is in the default byte ordering of the current system.
UCONV_OUT_SYSTEM_ENDIAN
The output parameter should be in the default byte ordering of the current system.
UCONV_IN_LITTLE_ENDIAN
The input parameter is in little endian byte ordering.
UCONV_OUT_LITTLE_ENDIAN
The output parameter should be in little endian byte ordering.
UCONV_IGNORE_NULL
The null or U+0000 character should not stop the conversion.
UCONV_IN_ACCEPT_BOM
If the Byte Order Mark (BOM, U+FEFF) character exists as the first character of the input parameter, interpret it as the
BOM character.
UCONV_OUT_EMIT_BOM
Start the output parameter with Byte Order Mark (BOM, U+FEFF) character to indicate the byte ordering if the output parame-
ter is in UTF-16 or UTF-32.
DESCRIPTION
The uconv_u16tou32() function reads the given utf16str in UTF-16 until U+0000 (zero) in utf16str is encountered as a character or until the
number of 16-bit unsigned integers specified in utf16len is read. The UTF-16 characters that are read are converted into UTF-32 and the
result is saved at utf32str. After the successful conversion, utf32len contains the number of 32-bit unsigned integers saved at utf32str as
UTF-32 characters.
The uconv_u16tou8() function reads the given utf16str in UTF-16 until U+0000 (zero) in utf16str is encountered as a character or until the
number of 16-bit unsigned integers specified in utf16len is read. The UTF-16 characters that are read are converted into UTF-8 and the
result is saved at utf8str. After the successful conversion, utf8len contains the number of bytes saved at utf8str as UTF-8 characters.
The uconv_u32tou16() function reads the given utf32str in UTF-32 until U+0000 (zero) in utf32str is encountered as a character or until the
number of 32-bit unsigned integers specified in utf32len is read. The UTF-32 characters that are read are converted into UTF-16 and the
result is saved at utf16str. After the successful conversion, utf16len contains the number of 16-bit unsigned integers saved at utf16str as
UTF-16 characters.
The uconv_u32tou8() function reads the given utf32str in UTF-32 until U+0000 (zero) in utf32str is encountered as a character or until the
number of 32-bit unsigned integers specified in utf32len is read. The UTF-32 characters that are read are converted into UTF-8 and the
result is saved at utf8str. After the successful conversion, utf8len contains the number of bytes saved at utf8str as UTF-8 characters.
The uconv_u8tou16() function reads the given utf8str in UTF-8 until the null ('