According to the Wikipedia article, UTF-8 has this format:
First code Last code Bytes Byte 1 Byte 2 Byte 3 Byte 4 point point Used U+0000 U+007F 1 0xxxxxxx U+0080 U+07FF 2 110xxxxx 10xxxxxx U+0800 U+FFFF 3 1110xxxx 10xxxxxx 10xxxxxx U+10000 U+1FFFFF 4 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx x means that this bit is used to select the code point.
This wastes two bits on each continuation byte and one bit in the first byte. Why is UTF-8 not encoded like the following?
First code Last code Bytes Byte 1 Byte 2 Byte 3 point point Used U+0000 U+007F 1 0xxxxxxx U+0080 U+3FFF 2 10xxxxxx xxxxxxxx U+0800 U+1FFFFF 3 110xxxxx xxxxxxxx xxxxxxxx
It would save one byte when the code point is out of the Basic Multilingual Plane or if the code point is in range [U+800,U+3FFF].
Why is UTF-8 not encoded in a more efficient way?