getwchar(3)

✨ getwchar β€” the manual page, but make it cute ✨

okay bestie, welcome to getwchar(3) from the Library Functions Manual πŸ’– get comfy, grab a strawberry πŸ“, and let's talk about reading wide characters off stdin like the icon she is.


πŸŽ€ NAME πŸŽ€

getwchar β€” read a wide character from standard input


πŸ’œ LIBRARY πŸ’œ

Standard C library (that's libc, link it with -lc) 🫢


🌸 SYNOPSIS 🌸

#include <wchar.h>

wint_t getwchar(void);

that's it. no arguments. she takes nothing and she gives you a wide character. queen of minimalism πŸ‘‘


✨ DESCRIPTION ✨

so. getwchar() is literally the wide-character equivalent of the getchar(3) function β€” same energy, wider vibe. it reads a wide character from stdin and returns it. that's the whole job, and she does it flawlessly πŸ’…

if the end of stream is reached, or if ferror(stdin) becomes true, she returns WEOF. no drama, just facts.

and if a wide-character conversion error happens? she sets errno to EILSEQ and returns WEOF. so like, if you see EILSEQ pop up, that's the conversion going "bestie i cannot work with this" 😭

oh and psst β€” if you wanted a nonlocking counterpart, go check unlocked_stdio(3) πŸ¦‹


πŸ”₯ RETURN VALUE πŸ”₯

getwchar() returns the next wide-character from standard input, or WEOF. that's the whole range of outcomes. either a character or the sad little WEOF. no in-between, periodt.


πŸ’– ATTRIBUTES πŸ’–

for an explanation of the terms used in this section, go peek at attributes(7) β€” iykyk πŸ‘‘

  • Interface: getwchar()
    • Attribute: Thread safety
    • Value: MT-Safe

so yes, she's MT-Safe, meaning you can call her from multiple threads and she will Not be messy about it. slay πŸ’…


🌈 STANDARDS 🌈

C11, POSIX.1-2008.


πŸ‘‘ HISTORY πŸ‘‘

C99, POSIX.1-2001.

she's been around. an OG. iconic behavior honestly πŸŽ€


πŸ¦‹ NOTES πŸ¦‹

the behavior of getwchar() depends on the LC_CTYPE category of the current locale. so like, locale matters, don't forget her fr fr.

and it is reasonable to expect that getwchar() will actually read a multibyte sequence from standard input and then convert it to a wide character. that's the vibe. multibyte in, wide character out 🧚


πŸ’€ SEE ALSO πŸ’€


so that's getwchar(3)! tiny function, huge main character energy, reads wide chars from stdin and never makes it weird πŸ’œ

mwah πŸ’‹ β€” this page came from Linux man-pages 6.20, dated 2026-02-08, and yeah that's the whole getwchar(3) footer, folded into a little sign-off because you deserve the full deets and also a goodbye hug 🫢✨

πŸ“¦ where this page comes from
  • arch rolling: man-pages 6.20-1 Β· BSD-2-Clause AND BSD-3-Clause AND BSD-4.3TAHOE AND BSD-4-Clause-UC AND GPL-1.0-or-later AND GPL-2.0-only AND GPL-2.0-or-later AND GPL-3.0-or-later AND LGPL-3.0-linking-exception AND LGPL-3.0-or-later AND LicenseRef-Public-Domain AND LicenseRef-UltraPermissive AND Linux-man-pages-1-para AND Linux-man-pages-copyleft AND Linux-man-pages-copyleft-2-para AND Linux-man-pages-copyleft-var AND MIT AND Spencer-94
  • nixpkgs unstable: man-pages 6.20
  • πŸ“œ the page's license: GPL-2.0-or-later
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms