towlower(3)

πŸ’– towlower(3) β€” the wide-char lowercase glow-up πŸ’–

okay bestie, so this one lives in the Library Functions Manual, and it's literally just: take a wide character, make it lowercase. that's it. that's the whole vibe. two functions, towlower and towlower_l, and they are not complicated, i promise. πŸ¦‹


πŸ“š LIBRARY

Standard C library (libc, -lc) β€” yeah girl, she's been in the group chat since forever. πŸ‘‘


✨ SYNOPSIS

#include <wctype.h>

wint_t towlower(wint_t wc);
wint_t towlower_l(wint_t wc, locale_t locale);

πŸŽ€ Feature Test Macro Requirements for glibc

(if you don't know what these are, go read feature_test_macros(7), i'll wait πŸ’…)

towlower_l():

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

🌸 DESCRIPTION

So here's the tea. towlower() is literally the wide-character version of tolower(3) β€” same energy, wider chars. πŸ™ˆ

Here's exactly what she does:

  • if wc is an uppercase wide character, AND there's a lowercase equivalent in the current locale β†’ she gives you back that lowercase equivalent
  • in all other cases β†’ wc comes right back to you, unchanged, no notes

Then there's towlower_l(), which does the exact same task but bases the conversion on the character type info in the locale you pass as locale. same job, different locale, iykyk. 🧚

⚠️ bestie please listen: the behavior of towlower_l() is undefined if locale is the special locale object LC_GLOBAL_LOCALE (go check duplocale(3)) or if it's not a valid locale object handle. undefined. we don't do that. πŸ’€

And about the argument wc β€” it must be representable as a wchar_t and be a valid character in the locale, or it can be the value WEOF. that's the rule, periodt.


🫢 RETURN VALUE

  • if wc was convertible to lowercase β†’ towlower() returns its lowercase equivalent πŸ’–
  • otherwise β†’ it returns wc

πŸ”₯ ATTRIBUTES

for an explanation of the terms used in this section, see attributes(7). (the original is a whole table but we're doing bullets, slay)

  • towlower() β€” Thread safety: MT-Safe locale
  • towlower_l() β€” Thread safety: MT-Safe

πŸ‘‘ STANDARDS

towlower()

  • C11, POSIX.1-2008 (XSI).

towlower_l()

  • POSIX.1-2008.

πŸ‘‘ STANDARDS (yes, again, the manpage said it twice and we respect the canon)

towlower()

  • C99, POSIX.1-2001 (XSI).
  • Obsolete in POSIX.1-2008 (XSI). 😭 she's a legacy queen.

towlower_l()

  • glibc 2.3.
  • POSIX.1-2008.

πŸ’œ NOTES

  • the behavior of these functions depends on the LC_CTYPE category of the locale. that's the whole plot. 🌈
  • real talk though: these functions are not very appropriate for dealing with Unicode characters, because Unicode knows about three cases: upper, lower, and title case. three. she can't hold all that. πŸ™ˆ

πŸ¦‹ SEE ALSO

iswlower(3), towctrans(3), towupper(3), locale(7)


and that's the whole page babes ✨ this was Linux man-pages 6.20, dated 2026-02-08, brought to you by the towlower(3) girlies. go lowercase something. no cap. πŸ’…πŸŽ€

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