%PAGEREF%(MinGW)

NAME
wctob - convert a wide character to a single byte

SYNOPSIS
#include <stdio.h>
#include <wchar.h>

int wctob( wint_t c );

DESCRIPTION
The wctob() function converts the wide character, represented by c, to a multibyte character sequence in the codeset which is associated with the LC_CTYPE category of the active process locale. Provided the entire conversion can be accommodated within a single byte, the value of that byte, interpreted as an unsigned char, and cast to an int, is returned; otherwise, EOF is returned.

RETURN VALUE
If the conversion of c, to a multibyte character sequence, in its entirety, occupies exactly one byte, the value of that byte, interpreted as an unsigned char, and cast to an int, is returned; otherwise, EOF is returned.

ERROR CONDITIONS
No error conditions are defined.

STANDARDS CONFORMANCE
Except to the extent that it may be affected by limitations of the underlying MS-Windows API, the libmingwex implementation of wctob() conforms generally to ISO-C99, POSIX.1-2001, and POSIX.1-2008.

CAVEATS AND BUGS
Use of the wctob() function is discouraged; it serves no purpose which may not be better served by the wcrtomb(3) function, which should be considered as a preferred alternative.

SEE ALSO
wcrtomb(3)

AUTHOR
This manpage was written by Keith Marshall, <keith@users.osdn.me>, to document the wctob() function as it has been implemented for the MinGW.org Project. It may be copied, modified and redistributed, without restriction of copyright, provided this acknowledgement of contribution by the original author remains in place.