A code unit is a storage unit that an encoding uses to represent a Unicode code point in memory. The code point identifies a character; the code units hold its encoded representation. Julia strings use UTF-8, so one character can occupy a variable number of code units rather than one fixed-size slot. section 11.1.1 section 11.5
Iterating safely through a UTF-8 string
For s = "Þrúðvangar", use firstindex(s), lastindex(s), and nextind(s, i) to move from one character boundary to the next. The resulting indices are 1, 3, 4, 6, 8, 9, 10, 11, 12, and 13, demonstrating why ordinary integer stepping is unsafe for UTF-8 strings.
