Skip to content
Free public beta until December 4, 2026: every course is open, no card needed. After that, the first chapter of each course stays free and full access is a one-time $39 ($19 for up to 100 founding members chosen for helpful feedback). Your progress is kept. How the beta works

UTF-8

The way Rust stores text: each character takes 1 to 4 bytes.

UTF-8 is a variable-width encoding of Unicode scalar values: ASCII characters take 1 byte and others take 2, 3, or 4. Every Rust String and str is valid UTF-8.

Loading interactive…

Examples

  • "a".len() is 1, "é".len() is 2 and "🦀".len() is 4: len() counts bytes, not characters.

Read the full section →