toascii(3)

✨ toascii(3) ✨

okay so bestie, welcome to the toascii page β€” it's in the Library Functions Manual, and ngl, this one is a little antique πŸ«–


πŸ’– NAME πŸ’–

toascii β€” convert character to ASCII


🌸 LIBRARY 🌸

Standard C library (libc, -lc)


πŸŽ€ SYNOPSIS πŸŽ€

#include <ctype.h>

[[deprecated]] int toascii(int c);

πŸ¦‹ Feature Test Macro Requirements for glibc (see feature_test_macros(7)): πŸ¦‹

toascii():

_XOPEN_SOURCE
    || /* glibc >= 2.19: */ _DEFAULT_SOURCE
    || /* glibc <= 2.19: */ _SVID_SOURCE || _BSD_SOURCE

πŸ’… DESCRIPTION πŸ’…

toascii() takes your c and converts it into a 7-bit unsigned char value that fits into the ASCII character set. how, you ask? it literally just clears the high-order bits. that's the whole trick. clearing. the. high. order. bits. πŸ’€


🌈 RETURN VALUE 🌈

the value it hands back is the converted character. that's it, that's the return. periodt.


⭐ ATTRIBUTES ⭐

for the full tea on what all these terms even mean, go peek at attributes(7) πŸ‘‘

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

(so yes bestie, she is MT-Safe β€” go off πŸ’š)


πŸ‘‘ STANDARDS πŸ‘‘

POSIX.1-2008.


πŸ•°οΈ HISTORY πŸ•°οΈ

SVr4, BSD, POSIX.1-2001. it got marked obsolete in POSIX.1-2008, and the reason is lowkey important: it cannot be used portably in a localized application. so… keep that in mind πŸ™ˆ


πŸ’€ BUGS πŸ’€

Many people will be unhappy if you use this function. This function will convert accented letters into random characters.

yeah. that's the actual documented bug. many people will be unhappy 😭 and your accented letters? turned into random characters. not the vibe check anyone asked for.


🫢 SEE ALSO 🫢

isascii(3), tolower(3), toupper(3)


and that's a wrap, bestie β€” this page came from Linux man-pages 6.20 and got its glow-up dated 2026-02-08 πŸŽ€ slay, go read the source instead if you can fr fr πŸ’–βœ¨

πŸ“¦ 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: Linux-man-pages-copyleft
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms