WCWIDTH(3POSIX)
π WCWIDTH(3POSIX) β the POSIX Programmer's Manual, bestie edition π
okay so first things first, this is WCWIDTH(3POSIX) from the POSIX Programmer's Manual, and I'm about to tell you everything about it π
β¨ PROLOG β¨ (yes it's giving fine print, but read it)
okay so this manual page is part of the POSIX Programmer's Manual. That's the whole vibe.
π«Ά heads up bestie: the Linux implementation of this interface may differ (so like, go consult the corresponding Linux manual page for details on Linux behavior), OR the interface may not be implemented on Linux at all. no cap, that's just how it is.
πΈ NAME πΈ
wcwidth β number of column positions of a wide-character code. that's it, that's the whole job π
π¦ SYNOPSIS π¦
#include <wchar.h>
int wcwidth(wchar_t wc);
look at her. short, sweet, iconic. π
π DESCRIPTION π
okay so the wcwidth() function shall determine the number of column positions required for the wide character wc. that's the mission, that's the assignment, and she ate. π
and the application shall ensure that the value of wc is a character representable as a wchar_t, and is a wide-character code corresponding to a valid character in the current locale. so likeβ¦ make sure you're feeding her something valid, or that's on you, not her π
π RETURN VALUE π
the wcwidth() function shall either:
- return
0β ifwcis a null wide-character code π«§ - return the number of column positions to be occupied by the wide-character code
wcπ - return
-1β ifwcdoes not correspond to a printable wide-character code π
three options, three moods, she contains multitudes. β
π ERRORS π
No errors are defined. nothing to report, no drama, we're chill. π
and also, the following sections are informative β so like, they're the vibes, not the law. iykyk π§
π EXAMPLES π
None. literally none. she said "figure it out" and honestly? respect. π
π₯ APPLICATION USAGE π₯
okay this part is actually important so listen up bestie:
this function was removed from the final ISO/IEC 9899:1990/Amendment 1:1995 (E), and the return value for a non-printable wide character is not specified.
π not me telling you the return value for a non-printable wide character is literally unspecified. it's giving undefined behavior energy. be careful out there.
π RATIONALE π
None. no reasoning provided, she simply is. main character energy, no explanation needed. π
π§ FUTURE DIRECTIONS π§
None. the future is unwritten and also empty. slay. β¨
π SEE ALSO π
wcswidth()β her sister, go say hi π«Ά- the Base Definitions volume of POSIX.1β2017, and
<wchar.h>π
π COPYRIGHT π
okay so legally I have to tell you this, and I'm gonna tell you it exactly:
Portions of this text are reprinted and reproduced in electronic form from IEEE Std 1003.1-2017, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 7, 2018 Edition, Copyright (C) 2018 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between this version and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html .
Any typographical or formatting errors that appear in this page are most likely to have been introduced during the conversion of the source files to man page format. To report such errors, see https://www.kernel.org/doc/man-pages/reporting_bugs.html .
and that's the whole page bestie!! π she's from IEEE/The Open Group, 2017 β so this iconic little man page is dated 2017, published under WCWIDTH(3POSIX), and I am obsessed with her. go forth and measure your column positions. periodt. πβ¨π¦
π¦ where this page comes from
- debian bookworm: manpages-posix-dev 2017a-2 Β· Other
- debian trixie: manpages-posix-dev 2017a-2 Β· Other
- ubuntu jammy: manpages-posix-dev 2017a-2 Β· Other
- ubuntu noble: manpages-posix-dev 2017a-2 Β· Other
- ubuntu resolute: manpages-posix-dev 2017a-2build1 Β· Other
- ubuntu stonking: manpages-posix-dev 2017a-2.1 Β· Other
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms