Is there any logic behind ASCII codes' ordering?

前端 未结 7 1996
星月不相逢
星月不相逢 2020-12-23 19:56

I was teaching C to my younger brother studying engineering. I was explaining him how different data-types are actually stored in the memory. I explained him the logistics b

7条回答
  •  执念已碎
    2020-12-23 20:24

    Wikipedia:

    The code itself was structured so that most control codes were together, and all graphic codes were together. The first two columns (32 positions) were reserved for control characters.[14] The "space" character had to come before graphics to make sorting algorithms easy, so it became position 0x20.[15] The committee decided it was important to support upper case 64-character alphabets, and chose to structure ASCII so it could easily be reduced to a usable 64-character set of graphic codes.[16] Lower case letters were therefore not interleaved with upper case. To keep options open for lower case letters and other graphics, the special and numeric codes were placed before the letters, and the letter 'A' was placed in position 0x41 to match the draft of the corresponding British standard.[17] The digits 0–9 were placed so they correspond to values in binary prefixed with 011, making conversion with binary-coded decimal straightforward.

提交回复
热议问题