Convert a single UTF-8 encoded character to a wide character.
#include <ldap_utf8.h>
int ldap_x_utf8_to_wc (
wchar_t *wchar,
const char *utf8char);
(OUT) Points to a wide character to receive the converted character code.
(IN) Address of the UTF8 sequence of bytes.
If successful, the function returns the length in bytes of the UTF-8 input character.
If utf8char is NULL or points to an empty string, the function returns 1 and a NULL is written to wchar.
If utf8char contains an invalid UTF-8 sequence -1 is returned.
char utchr_in[] = { 0xE2U, 0x98U, 0xA0U };
wchar_t wc_out;
int n;
/* Convert a UTF-8 character to a wide character.
Returns wc_out = 0x2620.
Returns n = 3. (Byte length of utchr_in)
*/
n = ldap_x_utf8_to_wc(&wc_out, utchr_in);