ASCII编码技术问询:字符串‘97’与整数97的表示方式
Great question—this cuts to a key distinction between textual characters and numeric values in ASCII, which trips up a lot of folks when they first learn about character encoding. Let's break this down clearly:
1. 字符串"97"的ASCII表示
The string "97" is made up of two separate, distinct ASCII characters: '9' and '7'. Each has its own unique ASCII code:
- The character
'9'corresponds to the ASCII number57(binary:0111001) - The character
'7'corresponds to the ASCII number55(binary:0110111)
So when stored as ASCII, the string "97" is the sequence of these two 7-bit values (or padded to 8 bits as bytes: 00111001 followed by 00110111). It’s just two characters next to each other—no mathematical meaning of "ninety-seven" here, just the symbols for the digits 9 and 7.
2. 整数97的ASCII表示
The integer 97 is a numeric value, but when we talk about its ASCII representation, we’re referring to the character that maps to the ASCII code 97. As you noted in your question, that's the lowercase letter 'a' (binary: 1100001).
It’s important to clarify: if you were storing the integer 97 in a computer (not as text), the binary value would still be 01100001 (same as the ASCII code for 'a'), but the semantics are totally different:
- One is a numeric value (97, which could be used in calculations)
- The other is a character (
'a', which is a symbol for text)
But in the context of the ASCII table, asking "what does integer 97 represent?" directly points to the character 'a'.
内容的提问来源于stack exchange,提问作者eran gal

