&gt; Swift has probably the most comprehensive Unicode string API I&#x27;ve seen<p>Perl 6 has long specified an interesting and rich approach to Unicode. Have you explored it?<p>(An initial implementation for an initial release of the Rakudo compiler was worked on over the last few years and declared done, modulo bugs, a few weeks ago. A recent blog post provides a friendly overview.[1].)<p>One notable difference is that Swift adopts an iteration-only view of strings for dealing with characters whereas Perl 6 does not. One consequence is that indexing operations in Perl 6 are O(1) (time) at the expense of potentially (and for the current implementation, typically) greater use of RAM.<p>&gt; BTW to your point on len(x) + len(y). The answer is 2 if you define len() on Unicode scalars but 1 if you define it on characters. Why? because len(&quot;\u301&quot;) should be 0.<p>Are you 100% sure of this of your last sentence (&quot;should be 0&quot;)? I get that it&#x27;s intuitively reasonable that an isolated base modifier be length 0 but I thought the Unicode standard specified (or at least recommended) that it be 1, and I note that Perl 6 treats isolated base modifiers (or at least this particular one) as length 1:<p>&gt; (&quot;a&quot;).chars
1<p>&gt; (0x301.chr).chars
1<p>&gt; (&quot;a&quot; ~ 0x301.chr).chars
1<p>So both Swift and Perl 6 correctly report the length of &quot;a&quot; as 1 and an &quot;a&quot; concatenated with &quot;\u301&quot; as 1 but disagree on what to do with an isolated base modifier.<p>&gt; It is, of course, true that getting this right is likely to be substantially more expensive than getting it wrong but that doesn&#x27;t mean it can&#x27;t be done.<p>Indeed.<p>[1] <a href="https:&#x2F;&#x2F;perl6advent.wordpress.com&#x2F;2015&#x2F;12&#x2F;07&#x2F;day-7-unicode-perl-6-and-you&#x2F;" rel="nofollow">https:&#x2F;&#x2F;perl6advent.wordpress.com&#x2F;2015&#x2F;12&#x2F;07&#x2F;day-7-unicode-p...</a>