putwchar(3)
π putwchar β bestie writes ONE wide char to stdout π
okay so this page is from the putwchar(3) manual β it lives in the Library Functions Manual section of your friendly neighborhood man pages, and it's about the tiniest little output function you ever did see. let's get into it π«Ά
β¨ NAME β¨
putwchar β write a wide character to standard output
like. that's it. that's the whole job. one (1) wide character. onto stdout. no notes π
π LIBRARY π
Standard C library β that's libc, and you link it with -lc.
πΈ SYNOPSIS πΈ
#include <wchar.h>
wint_t putwchar(wchar_t wc);
she's small, she's simple, she takes a wchar_t and she hands you back a wint_t. iconic behavior honestly β¨
π DESCRIPTION π
so putwchar() is literally the wide-character equivalent of the putchar(3) function. same energy, wider vibes. π
she writes the wide character wc to stdout. that's the mission. that's the whole mission.
here's the tea on what she returns tho:
- if
ferror(stdout)becomes true, she returnsWEOFπ - if a wide character conversion error occurs, she sets
errnotoEILSEQand returnsWEOF - otherwise? she returns
wcitself. queen shit π
and if you want a nonlocking counterpart, go see unlocked_stdio(3) β she's the chill younger sister who doesn't lock anything π
π RETURN VALUE π
putwchar() returns wc if no error occurred, or WEOF to indicate an error.
that's the whole thing. wc = we good. WEOF = something went wrong bestie, check the vibes π
π¦ ATTRIBUTES π¦
for an explanation of the terms used in this section, see attributes(7).
the table, but make it a bullet list because tables are not the moment:
putwchar()β Thread safety: MT-Safe β¨
MT-Safe!! she can handle her business across threads, no cap. we love a thread-safe girlie π«Ά
β STANDARDS β
C11, POSIX.1-2008.
certified, standardized, official. she's not just vibes, she's spec π
π HISTORY π
POSIX.1-2001, C99.
she's been around. a legacy icon. been putting wide chars on stdout since before some of us could walk π§
π NOTES π
The behavior of putwchar() depends on the LC_CTYPE category of the current locale.
π read that again: the locale is in charge here. LC_CTYPE decides how things go down, so if your output is being weird, check your locale first, bestie, fr fr.
It is reasonable to expect that putwchar() will actually write the multibyte sequence corresponding to the wide character wc.
so like β you hand her a wide character, she writes the multibyte sequence that corresponds to it. that's the reasonable expectation. that's the vibe check passing β
π₯ SEE ALSO π₯
okay that's the whole page, no crumbs left π this was Linux man-pages 6.20, dated 2026-02-08, and yes putwchar(3) really did eat and leave no crumbs. go write your wide chars, bestie, and remember: if it returns WEOF, something's up, check ferror(stdout) and errno, and slay π
β¨π
π¦ 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