编程与软件工程garbagecollected.org
四列 ASCII 表
Four Column ASCII
2017 — 2019,它一次次回到首页
黑点是上首页(≥ 50 分)的那次投稿,空心点是没冲上去的投稿,点越大分数越高。
导读
这篇博客把 ASCII 字符表按四列排版展示,让 0–127 的编码与字符对应关系以及其中的位模式规律更容易看出。读者可以借此观察控制字符、数字、大小写字母等区块的排列逻辑。
为什么经久不衰:ASCII 是每天都会碰到的基础编码,这种四列视图把它精心设计的位结构直观呈现出来,所以多年后仍值得一读。
HN 评论精选
DEL 编码为全 1,源于打孔卡无法撤销孔、只能全打孔表示删除。
我很喜欢的一个冷知识是:为什么 DEL 在 127,离其他控制码那么远。因为 0x7F 的 ASCII 七位全是 1。早期打孔卡(和电报?)时代,打错了没法把孔“取消”回 0,但可以把其余位都打孔,表示“忽略这个字符,我已删除它”,即 0b1111111。
warbiscuit查看英文原文
One bit of trivia I really love is why "DEL" is at 127 -- weirdly way away from all the control codes. It's because 0x7F is all ASCII bits set to "1". Back in the early punch card (and telegraph?) days, if there was a typo, you couldn't "unpunch" a hole to make it a 0 again, but you could punch out all the rest of them, indicating "ignore this char, I've deleted it" -- 0b1111111. source: http://www.trafficways.org/ascii/ascii.pdf which is a really neat read if you like that sort of thing :)
ASCII 的位布局允许裁掉一位得到 64 字符的大写子集。
ASCII 是经过精心设计的。我喜欢的一点是:如果不需要小写字母,可以整齐地切出一个 64 字符、6 位的全大写编码(类似 DEC 的做法)。
TazeTSchnitzel查看英文原文
ASCII was very carefully designed. One feature I like is that you can neatly cut out a 64-character 6-bit all-uppercase encoding (like DEC's) if you don't need lowercase. Wikipedia covers some of the design choices here: https://en.wikipedia.org/wiki/ASCII#Internal_organization
ASCII 布局有许多看似可优化但受历史约束的选择,值得追问。
还有更多门道。比如数字映射为自身二进制前面加 011:0 => ...0000,1 => ...0001,2 => ...0010。那为什么数字不从零行开始?为什么 0 是 0110000 而不是 0100000?为什么圆括号不和花括号、方括号同一行?为什么 &(et 的连字)不和 e 同一行?而 $(dollar)却和 d 同一行。
qznc查看英文原文
There is more to it. For example, note that the numerals map to their direct binary notation plus a 011 in front. 0 => ...0000, 1 => ...0001, 2 => ...0010, etc. Now I wonder, why don't they start in the zero row? In other words, why is 0 = 0110000, instead of 0100000? Why are the parens not in the same row as braces and brackets? Why isn't "&" (ligature of "et") not in the same row as "e"? "$" ("dollar") is in the same row as "d".
退格叠打让 ASCII 能用组合方式表示重音等字符,类似早期变长编码。
更多冷知识:ASCII 字符被设计成支持用退格(BS)进行叠打来生成更多字符。例如 á 可以写成 a + BS + '。尖音、重音、抑音和元音变音都可以这样叠加在小写字母上;ñ 是 n + BS + ~,ç 是 c + BS + 逗号。下划线是字符 + BS + 下划线,删除线类似,用破折号或波浪号;粗体是字符 + BS + 同一字符。许多 Compose 键序列就基于此。所以 ASCII 某种意义上可能是最早的变长编码集之一。
cryptonector查看英文原文
More trivia: ASCII characters were designed to support overstrike (using BS) to generate more characters. For example, á (á) can be written as a BS '. Acute, grave, and circumflex accents, and umlauts, can be written this way on lower-case letters. ñ is n BS ~. Cedille (ç) is c BS comma. Underline is character BS underscore; strikethrough is similar, using dash or tilde. Bold is character BS same_character. Many Compose key sequences are based on this. So ASCII, in a way, may well be the first -or one of the first- variable-length codeset. Note that overstriking upper-case letters to add diacritical marks does not work for ASCII (see more below). Also, overstriking was how one typed diacritical marks back in the days of mechanical typewriters. Spanish used to (and may still? I forget) permit upper-case letters to not carry diacritical marks precisely because it was difficult or costly to get typewriters and printers to print such letters. Adding diacritical marks to upper-case letters requires fonts designed for that, and clearly an overstrike sequence cannot work unless the typewriter/printer holds printing the character until it knows whether the next character is BS.
历次讨论
同类还值得读
开源应用架构
The Architecture of Open Source Applications
《开源软件架构》(AOSA)是一本在线免费书,邀请知名开源项目的作者亲自剖析其内部设计,涵盖 SQLAlchemy、LLVM、Audacity、Apache、Bash 等系统。
编程与软件工程上首页 9 次 · 2011–2024aosabook.org编辑精选编程语言简史:简短、不完整且多半错误
A Brief, Incomplete, and Mostly Wrong History of Programming Languages
一篇以戏谑、故意不准确的方式回顾编程语言史的博客文章,用夸张轶事和讽刺定义串起 Lisp、C、C++、Java、JavaScript、PHP 等语言。
编程与软件工程上首页 8 次 · 2009–2021james-iry.blogspot.comSQLite 是如何测试的
How SQLite is tested
SQLite 官方文档页,系统介绍 SQLite 的测试体系:多种测试方法(TCL 测试、模糊测试、回归测试、静态分析等)和海量测试用例,展示了这个小型开源项目如何靠极致测试获得…
编程与软件工程上首页 8 次 · 2009–2025sqlite.org编辑精选高级编程语言(2009)
Advanced programming languages (2009)
Matt Might 的经典文章,按用途推荐“高级编程语言”:如果追求就业就选主流语言,如果追求表达力、学术研究或创业,则推荐 Haskell、OCaml、Scala 等函数式语…
编程与软件工程上首页 8 次 · 2009–2022matt.might.net我的 Forth 与栈机器经历
Yosefk - My history with Forth & stack machines
作者以亲身经历回顾了使用 Forth 语言和栈式机器的历程:既赞叹其简洁优雅、代码量小、可自举的优点,也坦率指出栈操作在实际编程中的痛苦,以及 Forth 社区文化中的问题。
编程与软件工程上首页 8 次 · 2010–2024yosefk.com编辑精选