Test | Bin 2 | Oct 8 | Dec 10 | DoD 12 | Hex 16 |
---|---|---|---|---|---|
Bin 2 | 2 → 8 | 02 → 10 | 2 → 16 | ||
Oct 8 | 8 → 2 | 08 → 10 | 8 → 16 | ||
Dec 10 | 10 → 02 | 10 → 08 | 10 → 12 | 10 → 16 | |
DoDeca 12 | 12 → 10 | ||||
Hex 16 | 16 → 2 | 16 → 8 | 16 → 10 | 測驗/理論課 |
ASCII
(American Standard Code for Information Interchange) by ASA, 1963
EBCDIC (Extended Binary-Coded Decimal Interchange Code) by IBM, 1964
ISO8859 Family by International Organization for Standardization
國標碼 GB (CN/SG) 1980
HZ (CN)
char s[10]="0123"; s[0]=0xA4; s[1]=0x41; s[2]=0; printf("%s\n",s); // 乙
統一碼 unicode 1991 table python tutorial
Bits of code point |
First code point |
Last code point |
Bytes in sequence |
Byte 1 | Byte 2 | Byte 3 | Byte 4 | Byte 5 | Byte 6 |
---|---|---|---|---|---|---|---|---|---|
7 | U+0000 | U+007F | 1 | 0xxxxxxx |
|||||
11 | U+0080 | U+07FF | 2 | 110xxxxx |
10xxxxxx |
||||
16 | U+0800 | U+FFFF | 3 | 1110xxxx |
10xxxxxx |
10xxxxxx |
|||
21 | U+10000 | U+1FFFFF | 4 | 11110xxx |
10xxxxxx |
10xxxxxx |
10xxxxxx |
||
26 | U+200000 | U+3FFFFFF | 5 | 111110xx |
10xxxxxx |
10xxxxxx |
10xxxxxx |
10xxxxxx |
|
31 | U+4000000 | U+7FFFFFFF | 6 | 1111110x |
10xxxxxx |
10xxxxxx |
10xxxxxx |
10xxxxxx |
10xxxxxx |
Encoding Analysis
Fixed-length: let j = floor(i/bytes_per_char), bytes Bi belongs to Cj Stateful variable-length: scan backward until meeting SO or SI Stateless variable-length: scan backward until meeting a different bit-pattern UTF-8, UTF-16: scan backward at most 3 bytes