AttributedString’s Codable format and what it has to do with Unicode
['Ole Begemann']
Ole Begemann
The definition of what constitutes a Character , i.e. a user-perceived character, or a Unicode grapheme cluster, can and does change in new Unicode versions. This avoids the first issue but still isn’t safe, because some characters, such as the é in the example string, have more than one representation in Unicode: it can be either the standalone character é (Latin small letter e with acute) or the combination of e + ◌́ (Combining acute accent). There’s still a (smaller) potential problem here if the character boundary rules change for code points that span two adjacent text segments: the last character of run N and the first character of run N+1 might suddenly form a single character (grapheme cluster) in a new Unicode version.