logo
Kurashizu Blogwhere ideas flow
  • Home
  • News
  • Blog
  • About
  • Home
  • News
  • Blog
  • About

© 2026 Kurashizu. All rights reserved.

Admin·New Post·Service Status
Powered by Cloudflare·30.10.26
← Back to news

UTF-8000: Unlimited UTF-8

Original article
utf-8000.jb2170.com|109 points|81 comments|by vismit2000|Sep 20, 2026

UTF-8000: Unlimited UTF-8

To test the reference implementation, you can run: pipx install UTF-8000

[!IMPORTANT] Disclaimer: UTF-8000 is an independent project and is not endorsed by or affiliated with the Unicode Consortium.

TL;DR & Examples

The following table illustrates the bit-pattern evolution from standard ASCII and UTF-8 into the expanded UTF-8000 specification.

FormatBytesBit Pattern (Simplified)
ASCII10 xxxxxxx
UTF-82110 xxxx →\rightarrow→ 10 xxxxxx
31110 xxxx →\rightarrow→ 10 xxxxxx →\rightarrow→ 10 xxxxxx
411110 xxx →\rightarrow→ 10 xxxxxx →\rightarrow→ 10 xxxxxx →\rightarrow→ 10 xxxxxx
UTF-80005111110 xx →\rightarrow→ 10 xxxxxx ×4\times 4×4
61111110 x →\rightarrow→ 10 xxxxxx ×5\times 5×5
711111110 →\rightarrow→ 10 xxxxx →\rightarrow→ 10 xxxxxx ×5\times 5×5
811111111 →\rightarrow→ 10 0 xxxxx →\rightarrow→ 10 xxxxxx ×6\times 6×6
911111111 →\rightarrow→ 10 10 xxxx →\rightarrow→ 10 x xxxxx →\rightarrow→ 10 xxxxxx ×6\times 6×6
1011111111 →\rightarrow→ 10 110 xxx →\rightarrow→ 10 xx xxxx →\rightarrow→ 10 xxxxxx ×7\times 7×7
.........
2211 111111 →\rightarrow→ 10 111111 →\rightarrow→ 10 111111 →\rightarrow→ 10 110 xxx →\rightarrow→ 10 xx xxxx →\rightarrow→ 10 xxxxxx ×16\times 16×16

The 22-byte example provided above isn't a "special case"; rather, it serves as a prototypical demonstration of how UTF-8000 utilizes multiple start bytes to handle massive codepoints.

The Only Special Cases

UTF-8000 maintains almost total consistency, inheriting only two specific exceptions from UTF-8:

  1. ASCII: Handled exactly as is.
  2. 2-byte UTF-8: Requires 4\text{4}4 mandatory content bits to prevent overlong encoding (whereas all longer units require 5\text{5}5).

Anatomy of a Code Unit

Below is a conceptual breakdown of the 22-byte example mentioned in the TL;DR.

Key components identified in the anatomy:

  • Start Bytes: The initial sequence of bytes.
  • Final Start Byte: The last byte in the start sequence.
  • Continuation Bytes: All bytes following the start sequence.
  • Content Bits: The actual data bits of the codepoint.
  • Mandatory Content Bits: Specific bits used to validate encoding length; these may be split across the final start byte and the first non-start byte.

The core innovation of UTF-8000 is the clear methodology for dividing the first byte's highest bits into self-synchronization bits and start bits, and the subsequent "striping" of these start bits across continuation bytes to allow for infinite expansion.


Glossary

Terms are listed in order of conceptual introduction.

TermDefinition
CodepointAn unsigned, non-negative integer.
Code UnitThe full sequence of bytes used to represent one codepoint.
First ByteThe unique byte that initiates a code unit. Its prefix is either 0 (for ASCII) or 11 (for multi-byte). Also called the first start byte or non-continuation byte.
Continuation ByteAny byte following the first byte in a multi-byte sequence. It always begins with the prefix 10.
Self-Synchronization PrefixThe leading bits of any byte that identify it as either a first byte or a continuation byte.

Deep Dive: Self-Synchronization

The prefixes are designed as a prefix-free tree:

  • 0 →\rightarrow→ First byte (ASCII)
  • 1
    • 0 →\rightarrow→ Continuation byte
    • 1 →\rightarrow→ First byte (Multi-byte)

This architecture allows for byte-level self-synchronization. If you jump to a random position in a file, you can immediately determine your context:

  • If the byte starts with 0 or 11, you are at a first byte and can start decoding.
  • If it starts with 10, you are in the middle of a unit and must seek forward to the next first byte.

This is critical for:

  • Random Access: No need to read the file from the beginning to determine state.
  • Error Recovery: If a corrupt byte (e.g., 0xC0) is found, the decoder can insert a replacement character U+FFFD\text{U+FFFD}U+FFFD (\text{�}) and skip ahead to the next valid first byte.

Understanding Start Bytes

Start bytes appear contiguously at the beginning of a code unit. By allowing multiple start bytes, UTF-8000 can encode codepoints of any size.

  • Note: In casual conversation, ASCII bytes are sometimes called start bytes, though they technically lack "start bits."
  • Structure: A code unit begins with the first byte, followed by zero or more continuation bytes that also function as start bytes.
  • UTF-8 vs UTF-8000: In standard UTF-8, the "start byte" and "first byte" are the same thing because UTF-8 only ever requires one start byte, whether usin...