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
- Copyright 1995, James R. Van Zandt <jrv@vanzandt.mv.com>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms