萬盛學電腦網

您现在的位置: 萬盛學電腦網 >> 程式設計 >  >> 網頁製作 >> HTML5 教學

ASCII 碼表與 HTML 實體編碼:字符編碼基石完全指南

字符編碼基礎知識

ASCII(American Standard Code for Information Interchange)定義了 128 個字符(0-127),包含控制字符(0-31、127)和可打印字符(32-126)。HTML 基於 Unicode(UTF-8)但保留對 ASCII 及實體引用的兼容。

可打印 ASCII 字符對照表(32-126)

碼位字符名稱HTML 實體碼位字符名稱HTML 實體
32 Space` `64@At sign`@`
33!Exclamation`!`65AUppercase A`A`
34"Quotation`" / "`66BUppercase B`B`
35#Number sign`#`67CUppercase C`C`
36$Dollar`$`68DUppercase D`D`
37%Percent`%`69EUppercase E`E`
38&Ampersand`& / &`70FUppercase F`F`
39'Apostrophe`' / '`71GUppercase G`G`
40(Left paren`(`72HUppercase H`H`
41)Right paren`)`73IUppercase I`I`
42*Asterisk`*`74JUppercase J`J`
43+Plus`+`75KUppercase K`K`
44,Comma`,`76LUppercase L`L`
45-Hyphen`-`77MUppercase M`M`
46.Period`.`78NUppercase N`N`
47/Slash`/`79OUppercase O`O`
480Digit 0`0`80PUppercase P`P`
491Digit 1`1`81QUppercase Q`Q`
502Digit 2`2`82RUppercase R`R`
513Digit 3`3`83SUppercase S`S`
524Digit 4`4`84TUppercase T`T`
535Digit 5`5`85UUppercase U`U`
546Digit 6`6`86VUppercase V`V`
557Digit 7`7`87WUppercase W`W`
568Digit 8`8`88XUppercase X`X`
579Digit 9`9`89YUppercase Y`Y`
58:Colon`:`90ZUppercase Z`Z`
59;Semicolon`&#59;`91[Left bracket`[`
60<Less-than`&lt; / &#60;`92\Backslash`&#92;`
61=Equals`&#61;`93]Right bracket`&#93;`
62>Greater-than`&gt; / &#62;`94^Caret`&#94;`
63?Question`&#63;`95_Underscore`&#95;`
96`Grave accent`&#96;`97aLowercase a`&#97;`
98bLowercase b`&#98;`99cLowercase c`&#99;`
100dLowercase d`&#100;`101eLowercase e`&#101;`
102fLowercase f`&#102;`103gLowercase g`&#103;`
104hLowercase h`&#104;`105iLowercase i`&#105;`
106jLowercase j`&#106;`107kLowercase k`&#107;`
108lLowercase l`&#108;`109mLowercase m`&#109;`
110nLowercase n`&#110;`111oLowercase o`&#111;`
112pLowercase p`&#112;`113qLowercase q`&#113;`
114rLowercase r`&#114;`115sLowercase s`&#115;`
116tLowercase t`&#116;`117uLowercase u`&#117;`
118vLowercase v`&#118;`119wLowercase w`&#119;`
120xLowercase x`&#120;`121yLowercase y`&#121;`
122zLowercase z`&#122;`123{Left brace`&#123;`
124|Vertical bar`&#124;`125}Right brace`&#125;`
126~Tilde`&#126;`127DELDelete`&#127;`

控制字符(0-31、127)— 不可打印,HTML 中無意義

  • 常見:NUL(0)、SOH(1)、STX(2)、ETX(3)、EOT(4)、ENQ(5)、ACK(6)、BEL(7)、BS(8)、HT(9)、LF(10)、VT(11)、FF(12)、CR(13)、SO(14)、SI(15)、DLE(16)、DC1-4(17-20)、NAK(21)、SYN(22)、ETB(23)、CAN(24)、EM(25)、SUB(26)、ESC(27)、FS(28)、GS(29)、RS(30)、US(31)、DEL(127)
  • HTML 中僅 `HT (Tab)`、`LF (換行)`、`CR (回車)` 在 `
    `/`