TOWUPPER(3POSIX)

πŸ’– TOWUPPER πŸ’–

okay bestie, gather round, we're reading a manual page from the POSIX Programmer's Manual and honestly? it's giving lowercase-to-uppercase glow-up and i'm obsessed. this is towupper, and she's here to make your wide characters ✨capitalize✨.


🫢 PROLOG

so like, real talk before we start: this manual page is part of the POSIX Programmer's Manual. the Linux implementation of this interface may differ β€” so pls consult the corresponding Linux manual page for details on Linux behavior β€” or, lowkey, the interface might not even be implemented on Linux at all. not every platform shows up to the party, yk? 😭


🌸 NAME

  • towupper, towupper_l β€” transliterate lowercase wide-character code to uppercase πŸ’…

✨ SYNOPSIS

#include <wctype.h>

wint_t towupper(wint_t wc);
wint_t towupper_l(wint_t wc, locale_t locale);

πŸ¦‹ DESCRIPTION

for towupper(): the functionality described on this reference page is aligned with the ISO C standard. any conflict between the requirements described here and the ISO C standard is unintentional β€” no drama intended, fr fr. this volume of POSIX.1‐2017 defers to the ISO C standard. periodt.

so towupper() and towupper_l() have as a domain a type wint_t, and the value of it β€” the application shall make sure β€” is a character representable as a wchar_t, and a wide-character code corresponding to a valid character in the locale used by the function, or the value of WEOF. if the argument has any other value, the behavior is undefined πŸ’€ β€” like, that's not a vibe, that's just not defined, bestie.

if the argument of towupper() or towupper_l() represents a lowercase wide-character code, and there exists a corresponding uppercase wide-character code as defined by character type information in the current locale or in the locale represented by locale, respectively (category LC_CTYPE), then the result shall be the corresponding uppercase wide-character code. every other argument in the domain just gets returned unchanged β€” no notes, no edits, she comes as she is. πŸŽ€

and now the warning, and it's important: the behavior is undefined if the locale argument to towupper_l() is the special locale object LC_GLOBAL_LOCALE, or is not a valid locale object handle. do not pass her those. i'm serious. πŸ™ˆ

🌈 RETURN VALUE

upon successful completion, the towupper() and towupper_l() functions shall return the uppercase letter corresponding to the argument passed. otherwise, they shall return the argument unchanged. that's it, that's the whole mood. ✨


πŸ’œ ERRORS

no errors are defined. iconic, truly. nothing to report. 😌

the following sections are informative.


πŸŽ€ EXAMPLES

none. bestie really said "figure it out" 😭


πŸ“ APPLICATION USAGE

none. same energy. πŸ’…


🧚 RATIONALE

none. the reasoning is a mystery and honestly? we respect the privacy. πŸ‘‘


⭐ FUTURE DIRECTIONS

none. the future is a blank canvas and she's not planning ahead. 🌸


πŸ”₯ SEE ALSO

  • setlocale()
  • uselocale()
  • the Base Definitions volume of POSIX.1‐2017, Chapter 7, Locale, <locale.h>, <wctype.h>

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 β€” she's the final boss, no cap. 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 .


okay that's the whole page, bestie β€” this one's from the IEEE/The Open Group, dated 2017, and it lives in the manual as TOWUPPER(3POSIX). go forth and uppercase responsibly πŸ«ΆπŸ’–βœ¨