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