UTF-8:修訂版本之間的差異

出自福留子孫
跳轉到: 導覽搜尋
0~127
第 14 行: 第 14 行:
 
:字碼 = 7×4096+19×64+38=29926 ,字碼寫成 瓦
 
:字碼 = 7×4096+19×64+38=29926 ,字碼寫成 瓦
 
===0~127===
 
===0~127===
 
+
====0~31 控制字元====
 
+
<table class='nicetable'>
 +
<tr class='table-header'>
 +
<th>DEC</th>
 +
<th>OCT</th>
 +
<th>HEX</th>
 +
<th>BIN</th>
 +
<th>Symbol</th>
 +
<th>HTML Number</th>
 +
<th>HTML Name</th>
 +
<th>Description</th>
 +
</tr>
 +
<tr><td><a href='/0' title='ASCII Code 0'>0</a></td><td>000</td><td>00</td><td>00000000</td><td>NUL</td><td>&amp;#00;</td><td>&nbsp;</td><td>Null character</td></tr>
 +
<tr><td><a href='/1' title='ASCII Code 1'>1</a></td><td>001</td><td>01</td><td>00000001</td><td>SOH</td><td>&amp;#01;</td><td>&nbsp;</td><td>Start of Heading</td></tr>
 +
<tr><td><a href='/2' title='ASCII Code 2'>2</a></td><td>002</td><td>02</td><td>00000010</td><td>STX</td><td>&amp;#02;</td><td>&nbsp;</td><td>Start of Text</td></tr>
 +
<tr><td><a href='/3' title='ASCII Code 3'>3</a></td><td>003</td><td>03</td><td>00000011</td><td>ETX</td><td>&amp;#03;</td><td>&nbsp;</td><td>End of Text</td></tr>
 +
<tr><td><a href='/4' title='ASCII Code 4'>4</a></td><td>004</td><td>04</td><td>00000100</td><td>EOT</td><td>&amp;#04;</td><td>&nbsp;</td><td>End of Transmission</td></tr>
 +
<tr><td><a href='/5' title='ASCII Code 5'>5</a></td><td>005</td><td>05</td><td>00000101</td><td>ENQ</td><td>&amp;#05;</td><td>&nbsp;</td><td>Enquiry</td></tr>
 +
<tr><td><a href='/6' title='ASCII Code 6'>6</a></td><td>006</td><td>06</td><td>00000110</td><td>ACK</td><td>&amp;#06;</td><td>&nbsp;</td><td>Acknowledge</td></tr>
 +
<tr><td><a href='/7' title='ASCII Code 7'>7</a></td><td>007</td><td>07</td><td>00000111</td><td>BEL</td><td>&amp;#07;</td><td>&nbsp;</td><td>Bell, Alert</td></tr>
 +
<tr><td><a href='/8' title='ASCII Code 8'>8</a></td><td>010</td><td>08</td><td>00001000</td><td>BS</td><td>&amp;#08;</td><td>&nbsp;</td><td>Backspace</td></tr>
 +
<tr><td><a href='/9' title='ASCII Code 9'>9</a></td><td>011</td><td>09</td><td>00001001</td><td>HT</td><td>&amp;#09;</td><td>&nbsp;</td><td>Horizontal Tab</td></tr>
 +
<tr><td><a href='/10' title='ASCII Code 10'>10</a></td><td>012</td><td>0A</td><td>00001010</td><td>LF</td><td>&amp;#10;</td><td>&nbsp;</td><td>Line Feed</td></tr>
 +
<tr><td><a href='/11' title='ASCII Code 11'>11</a></td><td>013</td><td>0B</td><td>00001011</td><td>VT</td><td>&amp;#11;</td><td>&nbsp;</td><td>Vertical Tabulation</td></tr>
 +
<tr><td><a href='/12' title='ASCII Code 12'>12</a></td><td>014</td><td>0C</td><td>00001100</td><td>FF</td><td>&amp;#12;</td><td>&nbsp;</td><td>Form Feed</td></tr>
 +
<tr><td><a href='/13' title='ASCII Code 13'>13</a></td><td>015</td><td>0D</td><td>00001101</td><td>CR</td><td>&amp;#13;</td><td>&nbsp;</td><td>Carriage Return</td></tr>
 +
<tr><td><a href='/14' title='ASCII Code 14'>14</a></td><td>016</td><td>0E</td><td>00001110</td><td>SO</td><td>&amp;#14;</td><td>&nbsp;</td><td>Shift Out</td></tr>
 +
<tr><td><a href='/15' title='ASCII Code 15'>15</a></td><td>017</td><td>0F</td><td>00001111</td><td>SI</td><td>&amp;#15;</td><td>&nbsp;</td><td>Shift In</td></tr>
 +
<tr><td><a href='/16' title='ASCII Code 16'>16</a></td><td>020</td><td>10</td><td>00010000</td><td>DLE</td><td>&amp;#16;</td><td>&nbsp;</td><td>Data Link Escape</td></tr>
 +
<tr><td><a href='/17' title='ASCII Code 17'>17</a></td><td>021</td><td>11</td><td>00010001</td><td>DC1</td><td>&amp;#17;</td><td>&nbsp;</td><td>Device Control One (XON)</td></tr>
 +
<tr><td><a href='/18' title='ASCII Code 18'>18</a></td><td>022</td><td>12</td><td>00010010</td><td>DC2</td><td>&amp;#18;</td><td>&nbsp;</td><td>Device Control Two</td></tr>
 +
<tr><td><a href='/19' title='ASCII Code 19'>19</a></td><td>023</td><td>13</td><td>00010011</td><td>DC3</td><td>&amp;#19;</td><td>&nbsp;</td><td>Device Control Three (XOFF)</td></tr>
 +
<tr><td><a href='/20' title='ASCII Code 20'>20</a></td><td>024</td><td>14</td><td>00010100</td><td>DC4</td><td>&amp;#20;</td><td>&nbsp;</td><td>Device Control Four</td></tr>
 +
<tr><td><a href='/21' title='ASCII Code 21'>21</a></td><td>025</td><td>15</td><td>00010101</td><td>NAK</td><td>&amp;#21;</td><td>&nbsp;</td><td>Negative Acknowledge</td></tr>
 +
<tr><td><a href='/22' title='ASCII Code 22'>22</a></td><td>026</td><td>16</td><td>00010110</td><td>SYN</td><td>&amp;#22;</td><td>&nbsp;</td><td>Synchronous Idle</td></tr>
 +
<tr><td><a href='/23' title='ASCII Code 23'>23</a></td><td>027</td><td>17</td><td>00010111</td><td>ETB</td><td>&amp;#23;</td><td>&nbsp;</td><td>End of Transmission Block</td></tr>
 +
<tr><td><a href='/24' title='ASCII Code 24'>24</a></td><td>030</td><td>18</td><td>00011000</td><td>CAN</td><td>&amp;#24;</td><td>&nbsp;</td><td>Cancel</td></tr>
 +
<tr><td><a href='/25' title='ASCII Code 25'>25</a></td><td>031</td><td>19</td><td>00011001</td><td>EM</td><td>&amp;#25;</td><td>&nbsp;</td><td>End of medium</td></tr>
 +
<tr><td><a href='/26' title='ASCII Code 26'>26</a></td><td>032</td><td>1A</td><td>00011010</td><td>SUB</td><td>&amp;#26;</td><td>&nbsp;</td><td>Substitute</td></tr>
 +
<tr><td><a href='/27' title='ASCII Code 27'>27</a></td><td>033</td><td>1B</td><td>00011011</td><td>ESC</td><td>&amp;#27;</td><td>&nbsp;</td><td>Escape</td></tr>
 +
<tr><td><a href='/28' title='ASCII Code 28'>28</a></td><td>034</td><td>1C</td><td>00011100</td><td>FS</td><td>&amp;#28;</td><td>&nbsp;</td><td>File Separator</td></tr>
 +
<tr><td><a href='/29' title='ASCII Code 29'>29</a></td><td>035</td><td>1D</td><td>00011101</td><td>GS</td><td>&amp;#29;</td><td>&nbsp;</td><td>Group Separator</td></tr>
 +
<tr><td><a href='/30' title='ASCII Code 30'>30</a></td><td>036</td><td>1E</td><td>00011110</td><td>RS</td><td>&amp;#30;</td><td>&nbsp;</td><td>Record Separator</td></tr>
 +
<tr><td><a href='/31' title='ASCII Code 31'>31</a></td><td>037</td><td>1F</td><td>00011111</td><td>US</td><td>&amp;#31;</td><td>&nbsp;</td><td>Unit Separator</td></tr>
 +
</table>
 +
====32~31 控制字元====
  
 
===等價===:
 
===等價===:

2023年6月24日 (六) 21:21的修訂版本

UTF-8編碼位元組含義:

  • ◽◾◾◾◾◾◾◾,對於UTF-8編碼中的任意位元組B,如果B的第一位為0,則B獨立的表示一個字元(ASCII碼);
  • ◾◽??????,128~191,如果B的第一位為1,第二位為0,則B為一個多位元組字元中的一個位元組(非ASCII字元);
識別位元固定為 128 ,表值 0~63。
  • ◾◾◽?????,192~223,如果B的前兩位為1,第三位為0,則B為兩個位元組表示的字元中的第一個位元組;
識別位元固定為 192 ,(0~31)×64。
  • ◾◾◾◽????,224~239,如果B的前三位為1,第四位為0,則B為三個位元組表示的字元中的第一個位元組;
  • ◾◾◾◾◽???,240~247,如果B的前四位為1,第五位為0,則B為四個位元組表示的字元中的第一個位元組;

組成字(以「瓦」的中文 3 byte 為例):

  1. 第一 byte 231, 231-224=7 ,單位 4096
  2. 第二 byte 147, 147-128=19 ,單位 64
  3. 第三 byte 166, 166-128=38 ,單位 1
字碼 = 7×4096+19×64+38=29926 ,字碼寫成 &#29926;

0~127

0~31 控制字元

DEC OCT HEX BIN Symbol HTML Number HTML Name Description
<a href='/0' title='ASCII Code 0'>0</a>0000000000000NUL&#00; Null character
<a href='/1' title='ASCII Code 1'>1</a>0010100000001SOH&#01; Start of Heading
<a href='/2' title='ASCII Code 2'>2</a>0020200000010STX&#02; Start of Text
<a href='/3' title='ASCII Code 3'>3</a>0030300000011ETX&#03; End of Text
<a href='/4' title='ASCII Code 4'>4</a>0040400000100EOT&#04; End of Transmission
<a href='/5' title='ASCII Code 5'>5</a>0050500000101ENQ&#05; Enquiry
<a href='/6' title='ASCII Code 6'>6</a>0060600000110ACK&#06; Acknowledge
<a href='/7' title='ASCII Code 7'>7</a>0070700000111BEL&#07; Bell, Alert
<a href='/8' title='ASCII Code 8'>8</a>0100800001000BS&#08; Backspace
<a href='/9' title='ASCII Code 9'>9</a>0110900001001HT&#09; Horizontal Tab
<a href='/10' title='ASCII Code 10'>10</a>0120A00001010LF&#10; Line Feed
<a href='/11' title='ASCII Code 11'>11</a>0130B00001011VT&#11; Vertical Tabulation
<a href='/12' title='ASCII Code 12'>12</a>0140C00001100FF&#12; Form Feed
<a href='/13' title='ASCII Code 13'>13</a>0150D00001101CR&#13; Carriage Return
<a href='/14' title='ASCII Code 14'>14</a>0160E00001110SO&#14; Shift Out
<a href='/15' title='ASCII Code 15'>15</a>0170F00001111SI&#15; Shift In
<a href='/16' title='ASCII Code 16'>16</a>0201000010000DLE&#16; Data Link Escape
<a href='/17' title='ASCII Code 17'>17</a>0211100010001DC1&#17; Device Control One (XON)
<a href='/18' title='ASCII Code 18'>18</a>0221200010010DC2&#18; Device Control Two
<a href='/19' title='ASCII Code 19'>19</a>0231300010011DC3&#19; Device Control Three (XOFF)
<a href='/20' title='ASCII Code 20'>20</a>0241400010100DC4&#20; Device Control Four
<a href='/21' title='ASCII Code 21'>21</a>0251500010101NAK&#21; Negative Acknowledge
<a href='/22' title='ASCII Code 22'>22</a>0261600010110SYN&#22; Synchronous Idle
<a href='/23' title='ASCII Code 23'>23</a>0271700010111ETB&#23; End of Transmission Block
<a href='/24' title='ASCII Code 24'>24</a>0301800011000CAN&#24; Cancel
<a href='/25' title='ASCII Code 25'>25</a>0311900011001EM&#25; End of medium
<a href='/26' title='ASCII Code 26'>26</a>0321A00011010SUB&#26; Substitute
<a href='/27' title='ASCII Code 27'>27</a>0331B00011011ESC&#27; Escape
<a href='/28' title='ASCII Code 28'>28</a>0341C00011100FS&#28; File Separator
<a href='/29' title='ASCII Code 29'>29</a>0351D00011101GS&#29; Group Separator
<a href='/30' title='ASCII Code 30'>30</a>0361E00011110RS&#30; Record Separator
<a href='/31' title='ASCII Code 31'>31</a>0371F00011111US&#31; Unit Separator

32~31 控制字元

===等價===: 「◾◽??????」與「◽◽??????」皆合法且等價

  1. https://graphemica.com/%C2%A1
  2. https://www.ascii-code.com/
  3. http://jendo.org/study/showChar.html
  4. http://jendo.org/study/seeDecode.php