哪些ASCII字符已过时? [英] Which ASCII Characters are Obsolete?

查看:91
本文介绍了哪些ASCII字符已过时?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的理解是,在Teletype机器中包括了从0x00到0x1f范围内的ASCII字符.在现代时代,其中许多已经过时了.我很好奇在传统的字符串或文件中仍然可以找到哪些字符.根据我在C语言中编程的经验,我认为这些可能是NUL,LF,TAB,甚至是EOT.我对BS和ESC尤其好奇,因为我认为(可能类似于shift或控制)它们可能由OS处理,并且从未真正打印过或包含在字符串中.任何见识将不胜感激!

My understanding is that the ASCII characters found in the range from 0x00 to 0x1f were included with Teletype machines in mind. In the modern era, many of them have become obsolete. I was curious as to which characters might still be found in a conventional string or file. From my experience programming in C, I thought those might be NUL, LF, TAB, and maybe EOT. I'm especially curious about BS and ESC, as I thought (similar to shift or control maybe) that those might be handled by the OS and never really printed or be included in a string. Any amount of insight would be appreciated!

供参考的表:

推荐答案

在十六进制00到1F之间的字符中,您可能经常遇到的唯一字符是NUL(0x00 = \0),TAB(0x09 = \t) ,CR(0x0D = \r)和LF(0x0A = \n).其中,NUL在类似C的语言中用作字符串终止符,TAB用作制表符,而CR和LF在行尾使用. (使用的是一种复杂的情况;有关详细信息,包括历史记录,请参见Wikipedia文章 Newline 这是怎么回事.)

Out of the characters between hexadecimal 00 and 1F, the only ones you are likely to encounter frequently are NUL (0x00 = \0), TAB (0x09 = \t), CR (0x0D = \r), and LF (0x0A = \n). Of these, NUL is used in C-like languages as a string terminator, TAB is used as a tab character, and CR and LF are used at the end of a line. (Which one is used is a complicated situation; see the Wikipedia article Newline for details, including a history of how this came to be.)

与兼容VT100的终端仿真器进行通信时,会使用以下附加字符,但在该上下文之外很少见:

The following additional characters are used when communicating with VT100-compatible terminal emulators, but are rarely found outside that context:

  • BEL(0x07 = \a),这会导致终端发出蜂鸣和/或闪烁.
  • BS(0x08 = \b),用于将光标向左移动一个位置. (当您按下Backspace键时,它不会发送 ;请参见下文!)
  • SO和SI(0x0E0x0F),用于切换到某些特殊字符集.
  • ESC(0x1B = \e),在按Escape键和各种其他功能键时发送,另外还用于引入控制终端的转义序列.
  • DEL(0x7F),当您按退格键时发送.
  • BEL (0x07 = \a), which causes a terminal to beep and/or flash.
  • BS (0x08 = \b), which is used to move the cursor left one position. (It is not sent when you press the backspace key; see below!)
  • SO and SI (0x0E and 0x0F), which are used to switch into certain special character sets.
  • ESC (0x1B = \e), which is sent when pressing the Escape key and various other function keys, and is additionally used to introduce escape sequences which control the terminal.
  • DEL (0x7F), which is sent when you press the backspace key.

其余不可打印的ASCII字符基本上未使用.

The rest of the nonprintable ASCII characters are essentially unused.

这篇关于哪些ASCII字符已过时?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆