iswctype(3)
β¨ iswctype β wide-character classification β¨
okay bestie, gather round, because today we're learning about iswctype(3), which lives in the Library Functions Manual and honestly? She's a vibe. π
πΈ LIBRARY πΈ
Standard C library β that's libc, and you link it with -lc. iconic behavior, no notes. π«Ά
π SYNOPSIS π
#include <wctype.h>
int iswctype(wint_t wc, wctype_t desc);
π DESCRIPTION π
so here's the tea. You hand iswctype() a wide character in wc, plus a character property descriptor in desc, and it's basically doing a vibe check: does this character belong to the class that desc is describing? π
If yes β if wc is a wide character that has the character property designated by desc (or, put another way, belongs to the character class designated by desc) β then iswctype() returns nonzero. Slay.
Otherwise? It returns zero. Not slay.
And one more thing, bestie, don't sleep on this: if wc is WEOF, zero is returned. Every single time. No exceptions. π
also β and this is the part where you have to pay attention β desc must be a character property descriptor returned by the wctype(3) function. Like, it has to be one of those. Don't be out here making up your own descriptors, that's not the move. π
β RETURN VALUE β
iswctype()returns nonzero ifwchas the designated property. π- Otherwise, it returns 0.
that's it. that's the whole return value situation. periodt. π
π₯ ATTRIBUTES π₯
ngl, if any of these terms are confusing you, the glossary lives over in attributes(7), go check her out. π
iswctype()β Thread safety: MT-Safe
translation: she's thread-safe. multiple threads can pull up at the same time and nobody's gonna have a bad time. π―
π¦ STANDARDS π¦
- C11
- POSIX.1-2008
certified, standardized, main character energy. π
π HISTORY π
She's been around a minute, fr fr:
- POSIX.1-2001
- C99
elder icon behavior honestly. π
π NOTES π
okay so this is the part people forget and then they're confused later: the behavior of iswctype() depends on the LC_CTYPE category of the current locale. π
so like, the same character can get a totally different answer depending on where in the world your locale thinks it is. it's giving "context matters." don't forget it. π
π§ SEE ALSO π§
the whole girl gang, all of them:
iswalnum(3)iswalpha(3)iswblank(3)iswcntrl(3)iswdigit(3)iswgraph(3)iswlower(3)iswprint(3)iswpunct(3)iswspace(3)iswupper(3)iswxdigit(3)wctype(3)
lowkey reminder bestie:desccomes fromwctype(3). pair them up like the iconic duo they are. π«Ά
okay that's the whole page, mwah. π this one came to you courtesy of Linux man-pages 6.20, dated 2026-02-08 β and yes, that's iswctype(3), we been knew. πβ¨π¦
π¦ 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