1FGETWC(3) Linux Programmer's Manual FGETWC(3)
2
3
4
6 fgetwc, getwc - read a wide character from a FILE stream
7
9 #include <stdio.h>
10 #include <wchar.h>
11
12 wint_t fgetwc(FILE *stream);
13 wint_t getwc(FILE *stream);
14
16 The fgetwc() function is the wide-character equivalent of the fgetc(3)
17 function. It reads a wide character from stream and returns it. If
18 the end of stream is reached, or if ferror(stream) becomes true, it
19 returns WEOF. If a wide-character conversion error occurs, it sets
20 errno to EILSEQ and returns WEOF.
21
22 The getwc() function or macro functions identically to fgetwc(). It
23 may be implemented as a macro, and may evaluate its argument more than
24 once. There is no reason ever to use it.
25
26 For nonlocking counterparts, see unlocked_stdio(3).
27
29 The fgetwc() function returns the next wide-character from the stream,
30 or WEOF. In the event of an error, errno is set to indicate the cause.
31
33 Apart from the usual ones, there is
34
35 EILSEQ The data obtained from the input stream does not form a valid
36 character.
37
39 For an explanation of the terms used in this section, see
40 attributes(7).
41
42 ┌──────────────────┬───────────────┬─────────┐
43 │Interface │ Attribute │ Value │
44 ├──────────────────┼───────────────┼─────────┤
45 │fgetwc(), getwc() │ Thread safety │ MT-Safe │
46 └──────────────────┴───────────────┴─────────┘
48 POSIX.1-2001, POSIX.1-2008, C99.
49
51 The behavior of fgetwc() depends on the LC_CTYPE category of the cur‐
52 rent locale.
53
54 In the absence of additional information passed to the fopen(3) call,
55 it is reasonable to expect that fgetwc() will actually read a multibyte
56 sequence from the stream and then convert it to a wide character.
57
59 fgetws(3), fputwc(3), ungetwc(3), unlocked_stdio(3)
60
62 This page is part of release 4.15 of the Linux man-pages project. A
63 description of the project, information about reporting bugs, and the
64 latest version of this page, can be found at
65 https://www.kernel.org/doc/man-pages/.
66
67
68
69GNU 2015-08-08 FGETWC(3)