Menu Close

ASCII

在计算机中,所有的数据在存储和运算时都要使用二进制数表示(因为计算机用高电平和低电平分别表示1和0),例如,像a、b、c、d这样的52个字母(包括大写)以及0、1等数字还有一些常用的符号(例如*、#、@等)在计算机中存储时也要使用二进制数来表示,而具体用哪些二进制数字表示哪个符号,当然每个人都可以约定自己的一套(这就叫编码),而大家如果要想互相通信而不造成混乱,那么大家就必须使用相同的编码规则,于是美国有关的标准化组织就出台了ASCII编码,统一规定了上述常用符号用哪些二进制数来表示 。

美国信息交换标准代码是由美国国家标准学会(American National Standard Institute , ANSI )制定的,是一种标准的单字节字符编码方案,用于基于文本的数据。它最初是美国国家标准,供不同计算机在相互通信时用作共同遵守的西文字符编码标准,后来它被国际标准化组织(International Organization for Standardization, ISO)定为国际标准,称为ISO 646标准。适用于所有拉丁文字字母 。

表达方式

ASCII 码使用指定的7 位或8 位二进制数组合来表示128 或256 种可能的字符。标准ASCII 码也叫基础ASCII码,使用7 位二进制数(剩下的1位二进制为0)来表示所有的大写和小写字母,数字0 到9、标点符号,以及在美式英语中使用的特殊控制字符 。其中:
0~31及127(共33个)是控制字符或通信专用字符(其余为可显示字符),
控制符:LF(换行)、CR(回车)、FF(换页)、DEL(删除)、BS(退格)、BEL(响铃)等;
通信专用字符:SOH(文头)、EOT(文尾)、ACK(确认)等;ASCII值为8、9、10 和13 分别转换为退格、制表、换行和回车字符。它们并没有特定的图形显示,但会依不同的应用程序,而对文本显示有不同的影响 
32~126(共95个)是字符(32是空格),其中48~57为0到9十个阿拉伯数字。
65~90为26个大写英文字母,97~122号为26个小写英文字母,其余为一些标点符号、运算符号等。
同时还要注意,在标准ASCII中,其最高位(b7)用作奇偶校验位。所谓奇偶校验,是指在代码传送过程中用来检验是否出现错误的一种方法,一般分奇校验和偶校验两种。
1.奇校验规定:正确的代码一个字节中1的个数必须是奇数,若非奇数,则在最高位b7添1;
偶校验规定:正确的代码一个字节中1的个数必须是偶数,若非偶数,则在最高位b7添1 。
后128个称为扩展ASCII码。许多基于x86的系统都支持使用扩展(或“高”)ASCII。
扩展ASCII 码允许将每个字符的第8 位用于确定附加的128 个特殊符号字符、外来语字母和图形符号 

标准表

Full list of ASCII characters, letters, symbols and signs with descriptions:

ASCII control characters non printable :

ASCII code 00 = NULL ( Null character )
ASCII code 01 = SOH ( Start of Header )
ASCII code 02 = STX ( Start of Text )
ASCII code 03 = ETX ( End of Text, hearts card suit )
ASCII code 04 = EOT ( End of Transmission, diamonds card suit )
ASCII code 05 = ENQ ( Enquiry, clubs card suit )
ASCII code 06 = ACK ( Acknowledgement, spade card suit )
ASCII code 07 = BEL ( Bell )
ASCII code 08 = BS ( Backspace )
ASCII code 09 = HT ( Horizontal Tab )
ASCII code 10 = LF ( Line feed )
ASCII code 11 = VT ( Vertical Tab, male symbol, symbol for Mars )
ASCII code 12 = FF ( Form feed, female symbol, symbol for Venus )
ASCII code 13 = CR ( Carriage return )
ASCII code 14 = SO ( Shift Out )
ASCII code 15 = SI ( Shift In )
ASCII code 16 = DLE ( Data link escape )
ASCII code 17 = DC1 ( Device control 1 )
ASCII code 18 = DC2 ( Device control 2 )
ASCII code 19 = DC3 ( Device control 3 )
ASCII code 20 = DC4 ( Device control 4 )
ASCII code 21 = NAK ( NAK Negative-acknowledge )
ASCII code 22 = SYN ( Synchronous idle )
ASCII code 23 = ETB ( End of trans. block )
ASCII code 24 = CAN ( Cancel )
ASCII code 25 = EM ( End of medium )
ASCII code 26 = SUB ( Substitute )
ASCII code 27 = ESC ( Escape )
ASCII code 28 = FS ( File separator )
ASCII code 29 = GS ( Group separator )
ASCII code 30 = RS ( Record separator )
ASCII code 31 = US ( Unit separator )
ASCII code 127 = DEL ( Delete )

Printable ASCII characters :
( alphanumeric, symbols and signs )

ASCII code 32 = space ( Space )
ASCII code 33 = ! ( Exclamation mark )
ASCII code 34 =  ( Double quotes ; Quotation mark ; speech marks )
ASCII code 35 = # ( Number sign )
ASCII code 36 = $ ( Dollar sign )
ASCII code 37 = % ( Percent sign )
ASCII code 38 = & ( Ampersand )
ASCII code 39 =  ( Single quote or Apostrophe )
ASCII code 40 = ( ( round brackets or parentheses, opening round bracket )
ASCII code 41 = ) ( parentheses or round brackets, closing parentheses )
ASCII code 42 = * ( Asterisk )
ASCII code 43 = + ( Plus sign )
ASCII code 44 = , ( Comma )
ASCII code 45 =  ( Hyphen , minus sign )
ASCII code 46 = . ( Dot, full stop )
ASCII code 47 = / ( Slash , forward slash , fraction bar , division slash )
ASCII code 48 = 0 ( number zero )
ASCII code 49 = 1 ( number one )
ASCII code 50 = 2 ( number two )
ASCII code 51 = 3 ( number three )
ASCII code 52 = 4 ( number four )
ASCII code 53 = 5 ( number five )
ASCII code 54 = 6 ( number six )
ASCII code 55 = 7 ( number seven )
ASCII code 56 = 8 ( number eight )
ASCII code 57 = 9 ( number nine )
ASCII code 58 = : ( Colon )
ASCII code 59 = ; ( Semicolon )
ASCII code 60 = < ( Less-than sign )
ASCII code 61 = = ( Equals sign )
ASCII code 62 = > ( Greater-than sign ; Inequality )
ASCII code 63 = ? ( Question mark )
ASCII code 64 = @ ( At sign )
ASCII code 65 = A ( Capital letter A )
ASCII code 66 = B ( Capital letter B )
ASCII code 67 = C ( Capital letter C )
ASCII code 68 = D ( Capital letter D )
ASCII code 69 = E ( Capital letter E )
ASCII code 70 = F ( Capital letter F )
ASCII code 71 = G ( Capital letter G )
ASCII code 72 = H ( Capital letter H )
ASCII code 73 = I ( Capital letter I )
ASCII code 74 = J ( Capital letter J )
ASCII code 75 = K ( Capital letter K )
ASCII code 76 = L ( Capital letter L )
ASCII code 77 = M ( Capital letter M )
ASCII code 78 = N ( Capital letter N )
ASCII code 79 = O ( Capital letter O )
ASCII code 80 = P ( Capital letter P )
ASCII code 81 = Q ( Capital letter Q )
ASCII code 82 = R ( Capital letter R )
ASCII code 83 = S ( Capital letter S )
ASCII code 84 = T ( Capital letter T )
ASCII code 85 = U ( Capital letter U )
ASCII code 86 = V ( Capital letter V )
ASCII code 87 = W ( Capital letter W )
ASCII code 88 = X ( Capital letter X )
ASCII code 89 = Y ( Capital letter Y )
ASCII code 90 = Z ( Capital letter Z )
ASCII code 91 = [ ( square brackets or box brackets, opening bracket )
ASCII code 92 = \ ( Backslash , reverse slash )
ASCII code 93 = ] ( box brackets or square brackets, closing bracket )
ASCII code 94 = ^ ( Circumflex accent or Caret )
ASCII code 95 = _ ( underscore , understrike , underbar or low line )
ASCII code 96 = ` ( Grave accent )
ASCII code 97 = a ( Lowercase letter a , minuscule a )
ASCII code 98 = b ( Lowercase letter b , minuscule b )
ASCII code 99 = c ( Lowercase letter c , minuscule c )
ASCII code 100 = d ( Lowercase letter d , minuscule d )
ASCII code 101 = e ( Lowercase letter e , minuscule e )
ASCII code 102 = f ( Lowercase letter f , minuscule f )
ASCII code 103 = g ( Lowercase letter g , minuscule g )
ASCII code 104 = h ( Lowercase letter h , minuscule h )
ASCII code 105 = i ( Lowercase letter i , minuscule i )
ASCII code 106 = j ( Lowercase letter j , minuscule j )
ASCII code 107 = k ( Lowercase letter k , minuscule k )
ASCII code 108 = l ( Lowercase letter l , minuscule l )
ASCII code 109 = m ( Lowercase letter m , minuscule m )
ASCII code 110 = n ( Lowercase letter n , minuscule n )
ASCII code 111 = o ( Lowercase letter o , minuscule o )
ASCII code 112 = p ( Lowercase letter p , minuscule p )
ASCII code 113 = q ( Lowercase letter q , minuscule q )
ASCII code 114 = r ( Lowercase letter r , minuscule r )
ASCII code 115 = s ( Lowercase letter s , minuscule s )
ASCII code 116 = t ( Lowercase letter t , minuscule t )
ASCII code 117 = u ( Lowercase letter u , minuscule u )
ASCII code 118 = v ( Lowercase letter v , minuscule v )
ASCII code 119 = w ( Lowercase letter w , minuscule w )
ASCII code 120 = x ( Lowercase letter x , minuscule x )
ASCII code 121 = y ( Lowercase letter y , minuscule y )
ASCII code 122 = z ( Lowercase letter z , minuscule z )
ASCII code 123 = { ( braces or curly brackets, opening braces )
ASCII code 124 = | ( vertical-bar, vbar, vertical line or vertical slash )
ASCII code 125 = } ( curly brackets or braces, closing curly brackets )
ASCII code 126 = ~ ( Tilde ; swung dash )

ASCII Extended Characters :

ASCII code 128 = Ç ( Majuscule C-cedilla )
ASCII code 129 = ü ( letter u with umlaut or diaeresis , u-umlaut )
ASCII code 130 = é ( letter e with acute accent or e-acute )
ASCII code 131 = â ( letter a with circumflex accent or a-circumflex )
ASCII code 132 = ä ( letter a with umlaut or diaeresis , a-umlaut )
ASCII code 133 = à ( letter a with grave accent )
ASCII code 134 = å ( letter a with a ring )
ASCII code 135 = ç ( Minuscule c-cedilla )
ASCII code 136 = ê ( letter e with circumflex accent or e-circumflex )
ASCII code 137 = ë ( letter e with umlaut or diaeresis ; e-umlauts )
ASCII code 138 = è ( letter e with grave accent )
ASCII code 139 = ï ( letter i with umlaut or diaeresis ; i-umlaut )
ASCII code 140 = î ( letter i with circumflex accent or i-circumflex )
ASCII code 141 = ì ( letter i with grave accent )
ASCII code 142 = Ä ( letter A with umlaut or diaeresis ; A-umlaut )
ASCII code 143 = Å ( Capital letter A with a ring )
ASCII code 144 = É ( Capital letter E with acute accent or E-acute )
ASCII code 145 = æ ( Latin diphthong ae in lowercase )
ASCII code 146 = Æ ( Latin diphthong AE in uppercase )
ASCII code 147 = ô ( letter o with circumflex accent or o-circumflex )
ASCII code 148 = ö ( letter o with umlaut or diaeresis ; o-umlaut )
ASCII code 149 = ò ( letter o with grave accent )
ASCII code 150 = û ( letter u with circumflex accent or u-circumflex )
ASCII code 151 = ù ( letter u with grave accent )
ASCII code 152 = ÿ ( Lowercase letter y with diaeresis )
ASCII code 153 = Ö ( Letter O with umlaut or diaeresis ; O-umlaut )
ASCII code 154 = Ü ( Letter U with umlaut or diaeresis ; U-umlaut )
ASCII code 155 = ø ( Lowercase slashed zero or empty set )
ASCII code 156 = £ ( Pound sign ; symbol for the pound sterling )
ASCII code 157 = Ø ( Uppercase slashed zero or empty set )
ASCII code 158 = × ( Multiplication sign )
ASCII code 159 = ƒ ( Function sign ; f with hook sign ; florin sign )
ASCII code 160 = á ( Lowercase letter a with acute accent or a-acute )
ASCII code 161 = í ( Lowercase letter i with acute accent or i-acute )
ASCII code 162 = ó ( Lowercase letter o with acute accent or o-acute )
ASCII code 163 = ú ( Lowercase letter u with acute accent or u-acute )
ASCII code 164 = ñ ( eñe, enie, spanish letter enye, lowercase n with tilde )
ASCII code 165 = Ñ ( Spanish letter enye, uppercase N with tilde, EÑE, enie )
ASCII code 166 = ª ( feminine ordinal indicator )
ASCII code 167 = º ( masculine ordinal indicator )
ASCII code 168 = ¿ ( Inverted question marks )
ASCII code 169 = ® ( Registered trademark symbol )
ASCII code 170 = ¬ ( Logical negation symbol )
ASCII code 171 = ½ ( One half )
ASCII code 172 = ¼ ( Quarter, one fourth )
ASCII code 173 = ¡ ( Inverted exclamation marks )
ASCII code 174 = « ( Angle quotes, guillemets, right-pointing quotation mark )
ASCII code 175 = » ( Guillemets, angle quotes, left-pointing quotation marks )
ASCII code 176 =  ( Graphic character, low density dotted )
ASCII code 177 =  ( Graphic character, medium density dotted )
ASCII code 178 =  ( Graphic character, high density dotted )
ASCII code 179 =  ( Box drawing character single vertical line )
ASCII code 180 =  ( Box drawing character single vertical and left line )
ASCII code 181 = Á ( Capital letter A with acute accent or A-acute )
ASCII code 182 = Â ( Letter A with circumflex accent or A-circumflex )
ASCII code 183 = À ( Letter A with grave accent )
ASCII code 184 = © ( Copyright symbol )
ASCII code 185 =  ( Box drawing character double line vertical and left )
ASCII code 186 =  ( Box drawing character double vertical line )
ASCII code 187 =  ( Box drawing character double line upper right corner )
ASCII code 188 =  ( Box drawing character double line lower right corner )
ASCII code 189 = ¢ ( Cent symbol )
ASCII code 190 = ¥ ( YEN and YUAN sign )
ASCII code 191 =  ( Box drawing character single line upper right corner )
ASCII code 192 =  ( Box drawing character single line lower left corner )
ASCII code 193 =  ( Box drawing character single line horizontal and up )
ASCII code 194 =  ( Box drawing character single line horizontal down )
ASCII code 195 =  ( Box drawing character single line vertical and right )
ASCII code 196 =  ( Box drawing character single horizontal line )
ASCII code 197 =  ( Box drawing character single line horizontal vertical )
ASCII code 198 = ã ( Lowercase letter a with tilde or a-tilde )
ASCII code 199 = Ã ( Capital letter A with tilde or A-tilde )
ASCII code 200 =  ( Box drawing character double line lower left corner )
ASCII code 201 =  ( Box drawing character double line upper left corner )
ASCII code 202 =  ( Box drawing character double line horizontal and up )
ASCII code 203 =  ( Box drawing character double line horizontal down )
ASCII code 204 =  ( Box drawing character double line vertical and right )
ASCII code 205 =  ( Box drawing character double horizontal line )
ASCII code 206 =  ( Box drawing character double line horizontal vertical )
ASCII code 207 = ¤ ( Generic currency sign )
ASCII code 208 = ð ( Lowercase letter eth )
ASCII code 209 = Ð ( Capital letter Eth )
ASCII code 210 = Ê ( Letter E with circumflex accent or E-circumflex )
ASCII code 211 = Ë ( Letter E with umlaut or diaeresis, E-umlaut )
ASCII code 212 = È ( Capital letter E with grave accent )
ASCII code 213 = ı ( Lowercase dot less i )
ASCII code 214 = Í ( Capital letter I with acute accent or I-acute )
ASCII code 215 = Î ( Letter I with circumflex accent or I-circumflex )
ASCII code 216 = Ï ( Letter I with umlaut or diaeresis ; I-umlaut )
ASCII code 217 =  ( Box drawing character single line lower right corner )
ASCII code 218 =  ( Box drawing character single line upper left corner )
ASCII code 219 =  ( Block, graphic character )
ASCII code 220 =  ( Bottom half block )
ASCII code 221 = ¦ ( Vertical broken bar )
ASCII code 222 = Ì ( Capital letter I with grave accent )
ASCII code 223 =  ( Top half block )
ASCII code 224 = Ó ( Capital letter O with acute accent or O-acute )
ASCII code 225 = ß ( Letter Eszett ; scharfes S or sharp S )
ASCII code 226 = Ô ( Letter O with circumflex accent or O-circumflex )
ASCII code 227 = Ò ( Capital letter O with grave accent )
ASCII code 228 = õ ( Lowercase letter o with tilde or o-tilde )
ASCII code 229 = Õ ( Capital letter O with tilde or O-tilde )
ASCII code 230 = µ ( Lowercase letter Mu ; micro sign or micron )
ASCII code 231 = þ ( Lowercase letter Thorn )
ASCII code 232 = Þ ( Capital letter Thorn )
ASCII code 233 = Ú ( Capital letter U with acute accent or U-acute )
ASCII code 234 = Û ( Letter U with circumflex accent or U-circumflex )
ASCII code 235 = Ù ( Capital letter U with grave accent )
ASCII code 236 = ý ( Lowercase letter y with acute accent )
ASCII code 237 = Ý ( Capital letter Y with acute accent )
ASCII code 238 = ¯ ( Macron symbol )
ASCII code 239 = ´ ( Acute accent )
ASCII code 240 =  ( Congruence relation symbol )
ASCII code 241 = ± ( Plus-minus sign )
ASCII code 242 =  ( underline or underscore )
ASCII code 243 = ¾ ( three quarters, three-fourths )
ASCII code 244 =  ( Paragraph sign or pilcrow ; end paragraph mark )
ASCII code 245 = § ( Section sign )
ASCII code 246 = ÷ ( The division sign ; Obelus )
ASCII code 247 = ¸ ( cedilla )
ASCII code 248 = ° ( Degree symbol )
ASCII code 249 = ¨ ( Diaresis )
ASCII code 250 = · ( Interpunct or space dot )
ASCII code 251 = ¹ ( Superscript one, exponent 1, first power )
ASCII code 252 = ³ ( Superscript three, exponent 3, cube, third power )
ASCII code 253 = ² ( Superscript two, exponent 2, square, second power )
ASCII code 254 =  ( black square )
ASCII code 255 = nbsp ( Non-breaking space or no-break space )

大小规则

 常见ASCII码的大小规则:0~9<A~Z<a~z。

1)数字比字母要小。如 “7”<“F”;
2)数字0比数字9要小,并按0到9顺序递增。如 “3”<“8” ;
3)字母A比字母Z要小,并按A到Z顺序递增。如“A”<“Z” ;
4)同个字母的大写字母比小写字母要小32。如“A”<“a” 。
几个常见字母的ASCII码大小: “A”为65;“a”为97;“0”为 48。

问题

在英语中,用128个符号编码便可以表示所有,但是用来表示其他语言,128个符号是不够的。比如,在法语中,字母上方有注音符号,它就无法用 ASCII 码表示。于是,一些欧洲国家就决定,利用字节中闲置的最高位编入新的符号。比如,法语中的é的编码为130(二进制10000010)。这样一来,这些欧洲国家使用的编码体系,可以表示最多256个符号

但是,这里又出现了新的问题。不同的国家有不同的字母,因此,哪怕它们都使用256个符号的编码方式,代表的字母却不一样。比如,130在法语编码中代表了é,在希伯来语编码中却代表了字母Gimel (ג),在俄语编码中又会代表另一个符号。但是不管怎样,所有这些编码方式中,0–127表示的符号是一样的,不一样的只是128–255的这一段。
至于亚洲国家的文字,使用的符号就更多了,汉字就多达10万左右。一个字节只能表示256种符号,肯定是不够的,就必须使用多个字节表达一个符号。比如,简体中文常见的编码方式是 GB2312,使用两个字节表示一个汉字,所以理论上最多可以表示 256 x 256 = 65536 个符号 。

 

除教程外,本网站大部分文章来自互联网,如果有内容冒犯到你,请联系我们删除!