Chapter 3

Unicode and Text Normalization

Code points, bytes, grapheme clusters, UTF-8, normalization, case folding, punctuation, and scripts without spaces.

What this chapter does

Text is not just English words separated by spaces. This chapter teaches enough real text handling to avoid brittle tokenization.

Lessons

Read these in order.

Start with the chapter introduction, then move through the topic lessons. The order is chosen so each page can reuse ideas from the pages before it.

  1. 01
    Introduction

    Why real text handling matters before tokenization begins.

  2. 02
    Code Points, Bytes, and Graphemes

    Three layers of text representation that are easy to confuse.

  3. 03
    UTF-8

    A variable-length byte encoding that lets Unicode text live in files and network streams.

  4. 04
    Normalization and Case Folding

    Making equivalent-looking text comparable without erasing meaning carelessly.

  5. 05
    Punctuation and Whitespace

    Visible and invisible marks that affect boundaries, meaning, and token counts.

  6. 06
    Scripts Without Spaces

    Why word boundaries are not equally visible across writing systems.

Before moving on

  • Distinguish code points, bytes, and visible characters.
  • Explain why simple splitting fails on real text.
  • Inspect text before tokenizing it.

Where this leads

  • Tokens and Vocabularies
  • Subword Tokenization

Chapter progress