Syntax
#include <stdio.h> #include <wchar.h> int wctob(wint_t wc);Description
wctob determines whether wc corresponds to a member of the extended character set, whose multibyte character has a length of 1 byte
The behavior of wctob is affected by the LC_CTYPE category of the current locale.
If c corresponds to a multibyte character with a length of 1 byte, wctob returns the single-byte representation. Otherwise, wctob returns EOF.
This example uses wctob to test if the wide character A is a valid single-byte character.
#include <stdio.h>
#include <wchar.h>
int main(void)
{
   wint_t wc = L'A';
   if (wctob(wc) == wc)
      printf("%lc is a valid single byte character\n", wc);
   else
      printf("%lc is not a valid single byte character\n", wc);
   return 0;
   /****************************************************************************
      The output should be similar to :
      A is a valid single byte character
   ****************************************************************************/
}
Related Information