# Will Swift String's understanding of Characters remain stable?

**URL:** <https://forums.swift.org/t/will-swift-strings-understanding-of-characters-remain-stable/71164>\
**Category:** Using Swift\
**Tags:** string\
**Created:** [April 10, 2024, 7:41am UTC](https://forums.swift.org/t/will-swift-strings-understanding-of-characters-remain-stable/71164 "2024-04-10T07:41:24Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![ole](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/ole/32/18720_2.png) [@ole](https://forums.swift.org/u/ole)\
**Post date:** [April 10, 2024, 2:35pm UTC](https://forums.swift.org/t/will-swift-strings-understanding-of-characters-remain-stable/71164/3 "2024-04-10T14:35:16Z")

</div>

> [@Karl](#):
>
> If a String contains only scalars which are assigned in the standard library's version of Unicode, all of the properties you mention are indeed forward-stable.

I don't think this is true without exception, or at least it wasn't true in the past. For example, Unicode 9.0 changed the grapheme cluster boundary rules for emoji flags.

[The rule in Unicode 9.0](https://www.unicode.org/reports/tr29/tr29-29.html#Grapheme_Cluster_Boundary_Rules) (still current [in Unicode 15.1](https://www.unicode.org/reports/tr29/tr29-43.html#Grapheme_Cluster_Boundary_Rules)):

> Do not break within emoji flag sequences. That is, do not break between regional indicator (RI) symbols if there is an odd number of RI characters before the break point.

[The previous rule in Unicode 8.0](https://www.unicode.org/reports/tr29/tr29-27.html#Grapheme_Cluster_Boundary_Rules) was:

> Do not break between regional indicator symbols.

This changed the grapheme breaking rules for existing code points ([the regional indicator symbols](https://en.wikipedia.org/wiki/Regional_indicator_symbol) were introduced in Unicode 6.0).

For example, under Unicode 8.0 rules the string `let str = "🇦🇷🇯🇵"` would be treated as a single `Character` consisting of four code points. Since Unicode 9.0, it is treated as two `Character`s with two code points each.

---

_[View the full topic](https://forums.swift.org/t/will-swift-strings-understanding-of-characters-remain-stable/71164)._
