> For the complete documentation index, see [llms.txt](https://man.bsdcn.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://man.bsdcn.org/locale/toascii.3.md).

# toascii(3)

`toascii` — 将字节转换为 7 位 ASCII

## 名称

`toascii`

## 库

Lb libc

## 概要

`#include <ctype.h>`

`Ft int Fn toascii int c`

## 描述

`toascii` 函数去除一个字符中除低 7 位以外的所有位，包括奇偶校验位或其他标记位。

## 返回值

`toascii` 函数始终返回一个有效的 ASCII 字符。

## 参见

[digittoint(3)](/locale/digittoint.3.md), [isalnum(3)](/locale/isalnum.3.md), [isalpha(3)](/locale/isalpha.3.md), [isascii(3)](/locale/isascii.3.md), [iscntrl(3)](/locale/iscntrl.3.md), [isdigit(3)](/locale/isdigit.3.md), [isgraph(3)](/locale/isgraph.3.md), [islower(3)](/locale/islower.3.md), [isprint(3)](/locale/isprint.3.md), [ispunct(3)](/locale/ispunct.3.md), [isspace(3)](/locale/isspace.3.md), [isupper(3)](/locale/isupper.3.md), [isxdigit(3)](/locale/isxdigit.3.md), stdio(3), [tolower(3)](/locale/tolower.3.md), [toupper(3)](/locale/toupper.3.md), ascii(7)
