wctype(3)
๐ wctype(3) โ the wide-char vibe check function ๐
okay bestie, so we're in section 3 of the manual, which means we're talking library functions, and today's main character is wctype. she lives in the Standard C library (libc, link with -lc when you're compiling, mwah). let's get into it ๐ฆ
โจ SYNOPSIS โจ
#include <wctype.h>
wctype_t wctype(const char *name);
that's it. one function, one const char *, she's lowkey simple but she's doing so much for us ๐ซถ
๐ธ DESCRIPTION ๐ธ
okay so first let's talk about the type, because wctype_t is the whole point.
wctype_t represents a property that a wide character might or might not have. like, it's a whole class of wide characters, not one specific character. and here's the tea: what this type actually is on the inside is implementation-dependent โ nobody's promising you it looks any particular way. BUT. there's one thing everyone agrees on:
the special value (wctype_t) 0 means "invalid property". that's the zero. it's the "no thanks". it's the ick.
and any nonzero wctype_t value can be handed straight to iswctype(3) to actually test whether some given wide character has that property. so wctype() is like โ you ask for the property, iswctype() is the one who checks whether your character qualifies. they're a duo fr fr ๐
So, the actual function: wctype() returns a property, and you get to pick it by name. which names are valid? that depends on the LC_CTYPE category of your current locale โ locale-dependent, as always, she's dramatic like that. BUT these following names are valid in every single locale, no cap:
"alnum"โ realizes theisalnum(3)classification function โจ"alpha"โ realizes theisalpha(3)classification function โจ"blank"โ realizes theisblank(3)classification function โจ"cntrl"โ realizes theiscntrl(3)classification function โจ"digit"โ realizes theisdigit(3)classification function โจ"graph"โ realizes theisgraph(3)classification function โจ"lower"โ realizes theislower(3)classification function โจ"print"โ realizes theisprint(3)classification function โจ"punct"โ realizes theispunct(3)classification function โจ"space"โ realizes theisspace(3)classification function โจ"upper"โ realizes theisupper(3)classification function โจ"xdigit"โ realizes theisxdigit(3)classification function โจ
twelve of them, all iconic, all present everywhere. slay ๐
๐ RETURN VALUE ๐
- if the
nameyou passed is valid โ you get a property descriptor back. congratulations, she ate ๐ - otherwise โ you get
(wctype_t) 0. aka the invalid-property value. aka the void. aka not me getting zero again ๐ญ
๐ ATTRIBUTES ๐
for an explanation of the terms used in this section, go peek at attributes(7). ๐
- Interface:
wctype()- Attribute: Thread safety
- Value:
MT-Safe locale
so like, thread-safe, but locale-thread-safe, iykyk โ the locale part is doing work in that sentence. ๐
๐ STANDARDS ๐
C11, POSIX.1-2008. certified, blessed, official. periodt. โ
๐ง HISTORY ๐ง
POSIX.1-2001, C99. so she's been around, she's a legacy icon, she predates most of us knowing what a locale even is ๐
โญ NOTES โญ
the behavior of wctype() depends on the LC_CTYPE category of the current locale.
read that again bestie. it depends on the current locale. change your locale, change what names work. it's giving main character energy with a mood ring. ๐
๐ฆ SEE ALSO ๐ฆ
iswctype(3)โ the other half of the duo ๐
and that's the whole thing! this page came to you courtesy of Linux man-pages 6.20, dated 2026-02-08 โ okay love you bye, go classify some wide characters responsibly ๐โจ๐
๐ฆ 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