Previous Page
Next Page


Converts a byte character into a wide character

#include <stdio.h>
#include <wchar.h>
wint_t btowc ( int c  );

The btowc( ) function returns the corresponding wide character for its byte character argument, if possible. A return value of WEOF indicates that the argument's value is EOF, or that the argument does not represent a valid byte character representation in the initial shift state of a multibyte stream.


/* Build a table of wide characters for the first 128 byte values */
wchar_t low_table[128];

for ( int i = 0; i < 128 ; i++ )
  low_table[ i ] = (wchar_t)btowc( i );

See Also

wctob( ), mbtowc( ), wctomb( )

Previous Page
Next Page