Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why do upper case letters come before lower case letters in the ASCII table?

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.com but found nothing, could anyone gave me the answer? Thx a lot!

like image 213
Judking Avatar asked Oct 21 '12 02:10

Judking


People also ask

What is the relationship between the ASCII codes for uppercase and lowercase letters?

The ASCII value of the lowercase alphabet is from 97 to 122. And, the ASCII value of the uppercase alphabet is from 65 to 90. If the ASCII value of the character entered by the user lies in the range of 97 to 122 or from 65 to 90, that number is an alphabet.

Does lowercase come before upper case?

Capitalization is an indicator of importance, so capitalized terms should come first. Unfortunately, most of the case-sensitive computer sorting collations (such as ASCII) cannot help you as they sort all uppercase before all lower case. EG: Dog before cat .

What is the difference between upper and lowercase letters in ASCII?

Uppercase Letters − A - Z having ASCII values from 65 - 90 where, 65 and 90 are inclusive. Lowercase Letter − a - z having ASCII values from 97 - 122 where, 97 and 122 are inclusive. Numeric values − 0 - 9 having ASCII values from 48 - 57 where, 48 and 57 are inclusive.

What does it mean when you mix upper and lowercase letters?

Alternating caps are typically used to display mockery in text messages. The randomized capitalization leads to the flow of words being broken, making it harder for the text to be read as it disrupts word identification even when the size of the letters is the same as in uppercase or lowercase.


2 Answers

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.

Of course, we can dive a little deeper and ask why that attitude exists; historically, upper case came first and was the only shape the letters had for centuries or even millennia before the idea of case distinction was invented. For most folks literate in a language that uses the Latin alphabet, uppercase is the base form; you learn it first, the archetype of each letter is the capital shape, etc.

But it's worth noting that this ordering is nonetheless 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 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 alphabets don't have case distinctions at all, while others have more complicated relationships than our simple 1-to-1 mapping.

like image 174
Mark Reed Avatar answered Oct 06 '22 17:10

Mark Reed


To make sure that lowercase letters don't come before uppercase letters when sorting text.

In the modern Unicode era, sorting text is far more complicated, but 20 years ago, you could sort text by ASCII values.

like image 22
SLaks Avatar answered Oct 06 '22 17:10

SLaks