为什么在ASCII表中大写字母先于小写字母?

编程入门 行业动态 更新时间:2024-10-27 04:28:07
本文介绍了为什么在ASCII表中大写字母先于小写字母?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

在我的一次采访中,面试官问我,为什么大写字母在ASCII表的小写字母之前,我在google上进行了搜索,但没有找到任何答案,有人可以给我答案吗?非常感谢!

In one of my interview, the interviewer asked me why the upper case letters are before the lower case letters in ASCII table, I searched on google but found nothing, could anyone gave me the answer? Thx a lot!

推荐答案

我只是在猜测,但是我想这是因为最早的字符集根本没有小写字母. Baudot电报代码只有5位,而CDC主机本机使用6位代码.没有小写的余地.当ASCII被开发为7位代码,最终为小写字母留出足够的空间时,它们被认为是一种奢侈的附加组件,因此将它们放在集合的后半部分是有意义的.

I'm only guessing, but I imagine it's because the earliest character sets had no lowercase at all. The Baudot telegraph code was only 5 bits, and CDC mainframes natively used a 6-bit code; there was no room for lowercase. When ASCII was developed as a 7-bit code which finally had enough room for lowercase letters, they were considered something of a luxury add-on, so it made sense to put them in the back half of the set.

但是值得注意的是,该顺序 是特定于ASCII的,其他字符集不一定正确;例如,EBCDIC首先使用小写字母. Commodore微型计算机可以在两个字符集之间切换,即使这两个字符集都是基于ASCII的,但具有小写字母的字符集都首先使用它们. (另一组中有多余的图形字符代替小写.)

But it's worth noting that this ordering is specific to ASCII, and not necessarily true of other character sets; for example, EBCDIC has the lowercase letters first. Commodore microcomputers could switch between two character sets, and even though both were based on ASCII, the one with lowercase letters had them first. (The other set had extra graphic characters in place of lowercase.)

Unicode是从ASCII(以及基于它的扩展拉丁字符集)中汲取灵感的,因此,大多数具有区分大小写的字母的大写版本都首先出现在其代码块中.但是也有例外,当然许多其他字母根本没有大小写区别,而其他字母的关系比我们简单的一对一映射更复杂.

Unicode has taken its cue from ASCII (and the extended-Latin character sets based on it), so most of the alphabets that have case distinctions have the uppercase versions come first within their code blocks. But there are exceptions, and of course many other alphabets don't have case distinctions at all, while others have more complicated relationships than our simple 1-to-1 mapping.

更多推荐

为什么在ASCII表中大写字母先于小写字母?

本文发布于:2023-10-16 17:03:18,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1498188.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:中大   字母   写字母   ASCII

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!