towupper(3)

✨ towupper(3) β€” bestie edition ✨

okay so this is the manual page for towupper(3), and it's literally about turning wide characters UPPERCASE πŸ’… yes it's giving "why is my keyboard yelling" energy but it's actually so useful, trust.


🌸 NAME 🌸

towupper, towupper_l β€” convert a wide character to uppercase ✨

πŸ“š LIBRARY πŸ“š

Standard C library (libc, -lc) β€” the classic, the icon, the one and only 🫢

πŸŽ€ SYNOPSIS πŸŽ€

#include <wctype.h>

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

🧚 Feature Test Macro Requirements for glibc (see feature_test_macros(7)) 🧚

towupper_l():

  • Since glibc 2.10: _XOPEN_SOURCE >= 700
  • Before glibc 2.10: _GNU_SOURCE

so basically if you're on ancient glibc you gotta hit it with that _GNU_SOURCE, no cap.


πŸ’– DESCRIPTION πŸ’–

So towupper() is the wide-character version of toupper(3), like the glow-up edition. If wc is a lowercase wide character, and there's an uppercase equivalent chillin' in the current locale, it hands you the uppercase equivalent of wc. In literally every other case, it just gives you wc back, unchanged, no drama πŸ™ˆ

towupper_l() does the exact same task, except it does the conversion based on the character type info in the locale you specify with locale. Obsessed with the flexibility ngl.

⚠️ But watch out bestie: the behavior of towupper_l() is undefined if locale is that special locale object LC_GLOBAL_LOCALE (peep duplocale(3)) or if it's not a valid locale object handle. Undefined. Behavior. Not it. πŸ’€

Also the argument wc must be representable as a wchar_t and be a valid character in the locale, or just be the value WEOF. Like those are the rules, periodt.

πŸ”₯ RETURN VALUE πŸ”₯

If wc was convertible to uppercase, towupper() returns its uppercase equivalent. Otherwise it returns wc. Simple as that, main character behavior honestly πŸ‘‘

⭐ ATTRIBUTES ⭐

For the explanation of the terms used in this section, see attributes(7).

  • towupper() β€” Thread safety: MT-Safe locale
  • towupper_l() β€” Thread safety: MT-Safe

both of them ate, no crumbs πŸ’…

πŸ‘‘ STANDARDS πŸ‘‘

  • towupper() β€” C11, POSIX.1-2008 (XSI).
  • towupper_l() β€” POSIX.1-2008.

πŸ¦‹ HISTORY πŸ¦‹

  • towupper() β€” C99, POSIX.1-2001 (XSI). Obsolete in POSIX.1-2008 (XSI). 😭 rip bestie, you had a good run.
  • towupper_l() β€” POSIX.1-2008. glibc 2.3.

🌈 NOTES 🌈

The behavior of these functions depends on the LC_CTYPE category of the locale, so yeah, locale settings are literally running the show.

Also β€” and this is kinda important β€” these functions are not very appropriate for dealing with Unicode characters, because Unicode knows about three cases: upper, lower, and title case. Three. Not two. So like, if you're doing Unicode stuff, this is lowkey not the vibe 🫠 (iykyk)

πŸ’œ SEE ALSO πŸ’œ

iswupper(3), towctrans(3), towlower(3), locale(7)


anyway that's the whole page bestie, go forth and uppercase responsibly πŸŽ€βœ¨

Linux man-pages 6.20 β€” dated 2026-02-08 β€” and that's the towupper(3) page, signed, sealed, slayed πŸ’–

πŸ“¦ 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