What eight bits stand for when a character is at most U+00FF
A character whose code point is U+0000 through U+00FF is one byte, and these bits write that byte with the high bit first. H is 72 in decimal and 48 in hex, so the bits are 01001000. i is 01101001. Hi is the two groups 01001000 01101001, with a space between them. Values under 128 always start with 0, because the high bit of a seven-bit ASCII character is zero. Dropping that zero leaves seven bits, which is not this byte.
Decoding treats whitespace as the boundary between bytes. Each group must be exactly eight characters, and every character must be 0 or 1. 01001000 is H. 1001000 is the same integer with the leading zero removed, and it is not a group. 010010000 is nine bits. 0100100001101001 is sixteen bits with no space, so it is not the two bytes of Hi. A 0b prefix is a programming mark, not a bit.
For ASCII the byte is also the UTF-8 byte, so the same Hi is 48 69 in hex encode and decode and SGk= in Base64. A code point above U+00FF has no eight-bit group here. é is U+00E9, still inside the range, and its eight bits are 11101001, the single value E9. UTF-8 stores é as the two bytes C3 A9. Those bits are 11000011 10101001, which is a different spelling of the same character.
How eight bits, the space, and UTF-8 bytes line up
Why a character from U+0000 through U+00FF is exactly eight bits
- The code point is the byte. 0 through 255 fill eight bits, and the left-most bit is the 128s place.
- ASCII lives in 0 through 127, so the left-most bit is 0. A is 01000001, not 1000001. The shorter form is the same integer and a different length.
- One character is one group. Hi is two groups because it is two characters. The space marks that boundary. It is not a ninth bit.
Why a group fails when the length is not eight or the bits are not split
- A group is exactly eight digits, each 0 or 1. Seven digits, nine digits, or a 2 anywhere is not a byte in this spelling.
- Spaces, tabs, and line breaks separate groups. A continuous run is a single group. A run longer than eight digits is rejected rather than cut every eight digits.
- 0b01001000 puts a prefix in front of the bits. The b is not a binary digit. The eight bits of H begin only after that prefix is gone.
How these bits differ from hex and from the UTF-8 bytes of the same character
- Hex writes the same byte as two digits. 01001000 is 48 and 01101001 is 69. For ASCII the hex dump and these groups list the same bytes.
- Base64 groups six bits. It is a shorter spelling of those same ASCII bytes. Hi is SGk= there and 01001000 01101001 here.
- é is inside U+00FF, so it is one group, 11101001. UTF-8 stores é as C3 A9, two bytes, 11000011 10101001. That pair is not the one group above.
Why a character above U+00FF has no eight-bit group in this spelling
- Eight bits stop at 255. A CJK ideograph, an emoji, or any code point from U+0100 upward does not fit in one byte of this kind.
- UTF-8 would spread that character across two, three, or four bytes. This spelling does not make that split, so there is no group to emit.
- The UTF-8 bits of U+4E2D are 11100100 10111000 10101101, three bytes. Reading each group as a character from U+0000 through U+00FF does not rebuild the ideograph.
Where eight-bit groups are bytes and not the UTF-8 people expect
An ASCII word sitting next to its hex dump
Hi is the bytes 48 and 69. In bits that is 01001000 01101001. In hex it is 4869, two digits per byte, which is the subject of hex encode and decode. The space in the bit string is the same boundary as the boundary between 48 and 69. Removing the space glues the two bytes into one illegal group.
A bit string copied from a loop that printed digits with no gap
A program that prints each bit in a row produces 0100100001101001 for Hi. That is sixteen digits and one group, so it is not two bytes. The same bits with a space after the eighth digit are 01001000 01101001, which is Hi. The digits did not change. Only the boundary did.
A character someone expected to see as UTF-8 bits
é is one code point, U+00E9, and one group, 11101001. Its UTF-8 form is two bytes, C3 A9. A CJK ideograph is three UTF-8 bytes and does not fit in U+00FF at all. Those multi-byte sequences are a byte dump, which belongs with hex encode and decode, not one eight-bit group per character. The same ASCII bytes in a shorter alphabet are Base64.