wctrans(3)

โœจ wctrans(3) โ€” wide-character translation mapping โœจ

okay bestie, buckle up, we're doing wctrans(3) from the Library Functions Manual and it's lowkey iconic ๐Ÿ’…


๐Ÿ“š LIBRARY

Standard C library (libc, -lc) โ€” yeah she lives in libc, no extra install, she's just there for you fr fr ๐Ÿซถ


๐ŸŽ€ SYNOPSIS

#include <wctype.h>

wctrans_t wctrans(const char *name);

that's it. one function. one argument. she's simple and she's serving ๐Ÿ’–


๐ŸŒธ DESCRIPTION

so the wctrans_t type represents a mapping, and that mapping can take a wide character and turn it into, like, another wide character. a little glow-up for your characters, no cap โœจ

its nature is implementation-dependent (iykyk, it's giving "don't ask what's inside the box"), but there's one special value you gotta remember:

(wctrans_t) 0 means the mapping is invalid. like, dead. ghosted. ๐Ÿ’€

any nonzero wctrans_t value, though? you can pass that straight into towctrans(3) to actually do the wide-character mapping. that's where the magic happens ๐Ÿ”ฅ

The wctrans() function returns a mapping, given by its name. The set of valid names depends on the LC_CTYPE category of the current locale, but the following names are valid in all locales โ€” every single one, periodt ๐Ÿ‘‘

  • "tolower" โ€” realizes the tolower(3) mapping
  • "toupper" โ€” realizes the toupper(3) mapping

those two are the universally beloved ones, the main characters of name-land ๐Ÿ’œ


๐Ÿฆ‹ RETURN VALUE

If the name is valid, wctrans() returns a mapping descriptor. slay. ๐ŸŒˆ

Otherwise? it returns (wctrans_t) 0. invalid. nothing. a whole lot of nope. ๐Ÿ˜ญ


๐Ÿ’… ATTRIBUTES

For an explanation of the terms used in this section, see attributes(7). (That's the terms explainer, bestie, go read it if the words are giving mystery.)

  • Interface: wctrans()
  • Attribute: Thread safety
  • Value: MT-Safe locale

so she's MT-Safe locale, meaning: safe across threads, but she is paying attention to your locale, so keep that in mind ๐Ÿงš


๐Ÿ‘‘ STANDARDS

C11, POSIX.1-2008.

certified. official. she's got receipts ๐Ÿ“œ


โญ HISTORY

POSIX.1-2001, C99.

she's been around since forever and she's still relevant, that's longevity babe ๐Ÿ’–


๐Ÿ™ˆ NOTES

The behavior of wctrans() depends on the LC_CTYPE category of the current locale.

like, really depends on it. don't set your locale and then act surprised when the names you get back are different. vibe check your LC_CTYPE first ๐ŸŽ€


๐ŸŒŸ SEE ALSO

that's her partner in crime, the one who does the actual mapping once wctrans() hands over the descriptor. dynamic duo ๐Ÿค


kisses, this page came from Linux man-pages 6.20, dated 2026-02-08 ๐Ÿ’• go forth and map your wide characters responsibly โœจ

๐Ÿ“ฆ 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