mbtowc()

convert multibyte character to wide character 

Function


SYNOPSIS

#include <stdlib.h>

int mbtowc(wchar_t *pwc, const char *s, size_t n);


DESCRIPTION

The mbtowc() function converts the multibyte character addressed by s into the corresponding UNICODE character.


PARAMETERS

pwc 

Is the address of a wide character, type wchar_t, to receive the UNICODE equivalent of s.

s 

Points to the multibyte character to be converted to UNICODE.

n 

Is the maximum width, in bytes, for which to scan s for a valid multibyte sequence. Regardless of the value of n, no more than MB_CUR_MAX bytes are examined.


RETURN VALUES

If successful, mbtowc() returns the length, in bytes, of the multibyte character for which it found a UNICODE equivalent. If s is null or points to a null character, mbtowc() returns zero. If no valid multibyte sequence is found at s, mbtowc() returns -1.


CONFORMANCE

ANSI/ISO 9899-1990.


MULTITHREAD SAFETY LEVEL

MT-Safe, with exceptions.

This function is MT-Safe as long as no thread calls setlocale() while this function is executing.


PORTING ISSUES

None.


AVAILABILITY

MKS Toolkit for Professional Developers
MKS Toolkit for Enterprise Developers
MKS Toolkit for Enterprise Developers 64-Bit Edition


SEE ALSO

Functions:
mblen(), mbstowcs(), setlocale(), wctomb()


MKS Toolkit 9.2 Documentation Build 16.