title: Why is Swift counting this Grapheme Cluster as two characters instead of one?
body: <p>Generally Swift is <em>really</em> smart about counting grapheme clusters as a single character. If I want to make a Lebanese flag, for example, I can combine the two Unicode characters</p>
  
  <ul>
  <li>U+1F1F1 REGIONAL INDICATOR SYMBOL LETTER L</li>
  <li>U+1F1E7 REGIONAL INDICATOR SYMBOL LETTER B</li>
  </ul>
  
  <p>and as expected this is one character in Swift:</p>
  
  <pre><code>let s = "\u{1f1f1}\u{1f1e7}"
  assert(s.characters.count == 1)
  assert(s.utf16.count == 4)
  assert(s.utf8.count == 8)
  </code></pre>
  
  <p>However, let's say I want to make a Bicyclist emoji of Fitzpatrick Type-5. If I combine</p>
  
  <ul>
  <li>U+1F6B4 BICYCLIST</li>
  <li>U+1F3FE EMOJI MODIFIER FITZPATRICK TYPE-5</li>
  </ul>
  
  <p>Swift counts this combination as <em>two</em> characters!</p>
  
  <pre><code>let s = "\u{1f6b4}\u{1f3fe}"
  assert(s.characters.count == 2)   // &lt;----- WHY?
  assert(s.utf16.count == 4)
  assert(s.utf8.count == 8)
  </code></pre>
  
  <p>Why is this two characters instead of one?</p>
  
  <p>To show why I would expect it be 1, note that this cluster is actually interpreted as a valid emoji:</p>
  
  <p><a href="https://i.stack.imgur.com/7muEM.png" rel="noreferrer"><img src="https://i.stack.imgur.com/7muEM.png" alt="enter image description here"></a></p>