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 thetolower(3)mapping"toupper"โ realizes thetoupper(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