1fgetwc(3)                  Library Functions Manual                  fgetwc(3)
2
3
4

NAME

6       fgetwc, getwc - read a wide character from a FILE stream
7

LIBRARY

9       Standard C library (libc, -lc)
10

SYNOPSIS

12       #include <stdio.h>
13       #include <wchar.h>
14
15       wint_t fgetwc(FILE *stream);
16       wint_t getwc(FILE *stream);
17

DESCRIPTION

19       The  fgetwc() function is the wide-character equivalent of the fgetc(3)
20       function.  It reads a wide character from stream and  returns  it.   If
21       the end of stream is reached, or if ferror(stream) becomes true, it re‐
22       turns WEOF.  If a wide-character conversion error occurs, it sets errno
23       to EILSEQ and returns WEOF.
24
25       The  getwc()  function  or macro functions identically to fgetwc().  It
26       may be implemented as a macro, and may evaluate its argument more  than
27       once.  There is no reason ever to use it.
28
29       For nonlocking counterparts, see unlocked_stdio(3).
30

RETURN VALUE

32       On  success,  fgetwc() returns the next wide-character from the stream.
33       Otherwise, WEOF is returned, and errno is set to indicate the error.
34

ERRORS

36       Apart from the usual ones, there is
37
38       EILSEQ The data obtained from the input stream does not  form  a  valid
39              character.
40

ATTRIBUTES

42       For  an  explanation  of  the  terms  used  in  this  section,  see at‐
43       tributes(7).
44
45       ┌────────────────────────────────────────────┬───────────────┬─────────┐
46Interface                                   Attribute     Value   
47       ├────────────────────────────────────────────┼───────────────┼─────────┤
48fgetwc(), getwc()                           │ Thread safety │ MT-Safe │
49       └────────────────────────────────────────────┴───────────────┴─────────┘
50

STANDARDS

52       C11, POSIX.1-2008.
53

HISTORY

55       POSIX.1-2001, C99.
56

NOTES

58       The behavior of fgetwc() depends on the LC_CTYPE category of  the  cur‐
59       rent locale.
60
61       In  the  absence of additional information passed to the fopen(3) call,
62       it is reasonable to expect that fgetwc() will actually read a multibyte
63       sequence from the stream and then convert it to a wide character.
64

SEE ALSO

66       fgetws(3), fputwc(3), ungetwc(3), unlocked_stdio(3)
67
68
69
70Linux man-pages 6.04              2023-03-30                         fgetwc(3)
Impressum