The <wchar.h> include file declares the supported subset of the ISO/C Multibyte support extensions defined in ISO/IEC 9889:1990/Amendment 1:1993(E) extensions. The following functions are declared in <wchar.h>:
| fgetwc | putwc | wcscpy | wcsstr |
| fgetws | putwchar | wcscspn | wcstod |
| fputwc | swprintf | wcsftime | wcstok |
| fputws | swscanf | wcslen | wcstol |
| getwc | ungetwc | wcsncat | wcstoul |
| getwchar | vswprintf | wcsncmp | wcswidth |
| getwmccoll | wcrtomb | wcsncpy | wcsxfrm |
| mbrlen | wcscat | wcspbrk | wctob |
| mbrtowc | wcschr | wcsrchr | wcwidth |
| mbsinit | wcscmp | wcsrtombs | |
| mbsrtowcs | wcscoll | wcsspn |
You do not need to include <stdio.h> and <stdarg.h> to use this include file.
<wchar.h> also defines the following types and constants:
mbstate_t:
Conversion state information needed when converting between
sequences of multibyte characters and wide characters.
size_t:
typedef for the type of the value returned by sizeof.
wchar_t:
typedef for a wide character constant.
wint_t:
An integral type unchanged by integral promotions, that can hold
any value corresponding to members of the extended character set,
as well as WEOF (see below).
FILE:
The FILE structure type is defined in <stdio.h>. Stream
functions use a pointer to the FILE type to get access to a given
stream. The system uses the information in the FILE structure to
maintain the stream. The C standard streams stdin, stdout, and
stderr are also defined in <stdio.h>.
va_list:
This type is also defined in <stdio.h>.
NULL:
A pointer that never points to a data object.
WEOF:
Expands to a constant expression of type wint_t, whose
value does not correspond to any member of the extended character
set. It indicates EOF.
You can perform wide character input/output on the streams described in the ISO/IEC 9899:1990 standard, subclause 7.9.2. This standard expands the definition of a stream to include an orientation for both text and binary streams. After you have associated a stream with an external file, but before you have performed any operations on it, the stream does not have any orientation. Once you apply a wide character input or output function to a stream that does not have orientation, the stream becomes wide-oriented. Similarly, once you apply a byte input or output function to a stream without orientation, the stream becomes byte-oriented.
After you establish a stream's orientation, the only way to change it is to make a successful call to the freopen function, which removes a stream's orientation.
![]()
setlocale -- Set Locale
<locale.h>