iswpunct(3)
β¨ iswpunct(3) β¨
okay bestie, so this is iswpunct(3) from the Library Functions Manual, and honestly? it's giving "tiny function, big personality" π
let's get into it.
π«Ά NAME
iswpunct β the one that tests for a punctuation or symbolic wide character π
π LIBRARY
Standard C library (libc, -lc) π
πΈ SYNOPSIS
#include <wctype.h>
int iswpunct(wint_t wc);
π« DESCRIPTION
So iswpunct() is literally the wide-character equivalent of the ispunct(3) function, no cap. What it does is check whether wc is a wide character that belongs to the wide-character class "punct". that's it, that's the job π¦
Now here's the lore, and it's actually kind of iconic:
- The wide-character class
"punct"is a subclass of the wide-character class"graph", which means it's also a subclass of the wide-character class"print". nesting dolls fr fr πͺ - The wide-character class
"punct"is disjoint from the wide-character class"alnum"β and therefore also disjoint from all of its subclasses:"alpha","upper","lower","digit","xdigit". not overlapping, not even a little π - Because it's a subclass of
"print", the"punct"class is disjoint from the"cntrl"class too β¨ - And because it's a subclass of
"graph","punct"is disjoint from"space"and its subclass"blank". bye bestie π
so basically: punctuation/symbols stay in their lane and everyone else stays in theirs. the vibe check is mutual and permanent π
π₯ RETURN VALUE
- returns nonzero if
wcis a wide character belonging to the wide-character class"punct"π - otherwise, it returns zero π
π ATTRIBUTES
For the tea on what all these terms even mean, go peek at attributes(7). but here's the breakdown:
iswpunct()- Attribute: Thread safety
- Value:
MT-Safe localeπ
π STANDARDS
C11, POSIX.1-2008. certified, standardized, slay β
π°οΈ HISTORY
POSIX.1-2001, C99. it's been around, it's got seniority π§
π NOTES
- The behavior of
iswpunct()depends on theLC_CTYPEcategory of the current locale. so like, your locale is lowkey the main character here π - Okay so this one's important: this function's name is a misnomer when you're dealing with Unicode characters π because the wide-character class
"punct"contains both punctuation characters and symbol characters (math, currency, etc.). so the name says "punct" but it's actually doing punct + symbols. not me being deceived by a function name π
π SEE ALSO
π that's the whole page bestie, go forth and classify your wide characters responsibly π«Ά
and that's a wrap on the Linux man-pages 6.20 page dated 2026-02-08 β this came straight from iswpunct(3) and she ate, periodt π
β¨π
π¦ 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