| 1 |
'\" t |
| 2 |
.\" Copyright 1995, James R. Van Zandt <[email protected]> |
| 3 |
.\" Copyright, the authors of the Linux man-pages project |
| 4 |
.\" |
| 5 |
.\" SPDX-License-Identifier: Linux-man-pages-copyleft |
| 6 |
.\" |
| 7 |
.TH toascii 3 2026-02-08 "Linux man-pages 6.18" |
| 8 |
.SH NAME |
| 9 |
toascii \- convert character to ASCII |
| 10 |
.SH LIBRARY |
| 11 |
Standard C library |
| 12 |
.RI ( libc ,\~ \-lc ) |
| 13 |
.SH SYNOPSIS |
| 14 |
.nf |
| 15 |
.B #include <ctype.h> |
| 16 |
.P |
| 17 |
.BI "[[deprecated]] int toascii(int " c ); |
| 18 |
.fi |
| 19 |
.P |
| 20 |
.RS -4 |
| 21 |
Feature Test Macro Requirements for glibc (see |
| 22 |
.BR feature_test_macros (7)): |
| 23 |
.RE |
| 24 |
.P |
| 25 |
.BR toascii (): |
| 26 |
.nf |
| 27 |
_XOPEN_SOURCE |
| 28 |
|| /* glibc >= 2.19: */ _DEFAULT_SOURCE |
| 29 |
|| /* glibc <= 2.19: */ _SVID_SOURCE || _BSD_SOURCE |
| 30 |
.fi |
| 31 |
.SH DESCRIPTION |
| 32 |
.BR toascii () |
| 33 |
converts |
| 34 |
.I c |
| 35 |
to a 7-bit |
| 36 |
.I "unsigned char" |
| 37 |
value that fits into the ASCII character set, by clearing the |
| 38 |
high-order bits. |
| 39 |
.SH RETURN VALUE |
| 40 |
The value returned is that of the converted character. |
| 41 |
.SH ATTRIBUTES |
| 42 |
For an explanation of the terms used in this section, see |
| 43 |
.BR attributes (7). |
| 44 |
.TS |
| 45 |
allbox; |
| 46 |
lbx lb lb |
| 47 |
l l l. |
| 48 |
Interface Attribute Value |
| 49 |
T{ |
| 50 |
.na |
| 51 |
.nh |
| 52 |
.BR toascii () |
| 53 |
T} Thread safety MT-Safe |
| 54 |
.TE |
| 55 |
.SH STANDARDS |
| 56 |
POSIX.1-2008. |
| 57 |
.SH HISTORY |
| 58 |
SVr4, BSD, POSIX.1-2001. |
| 59 |
Obsolete in POSIX.1-2008, |
| 60 |
noting that it cannot be used portably in a localized application. |
| 61 |
.SH BUGS |
| 62 |
Many people will be unhappy if you use this function. |
| 63 |
This function will convert accented letters into random characters. |
| 64 |
.SH SEE ALSO |
| 65 |
.BR isascii (3), |
| 66 |
.BR tolower (3), |
| 67 |
.BR toupper (3) |