title: Convert between diacritic variants of a character
body: <p>I'm passing a string as a parameter to command line tool written in swift.</p>
  <p>I have a problem with some characters containing diacritics.</p>
  <p>If I pass <code>à á ả ã ạ й ё</code> as a line argument, inside the app I got <code>à á ả ã ạ й ё</code>. It looks the same, but it's not:</p>
  <pre><code>func printUnicodeScalars(_ string: String) {
      print(string, &quot;-&gt;&quot;, string.unicodeScalars.map { $0 })
  }
  printUnicodeScalars(&quot;à á ả ã ạ й ё&quot;)
  // à á ả ã ạ й ё -&gt; [&quot;\u{00E0}&quot;, &quot; &quot;, &quot;\u{00E1}&quot;, &quot; &quot;, &quot;\u{1EA3}&quot;, &quot; &quot;, &quot;\u{00E3}&quot;, &quot; &quot;, &quot;\u{1EA1}&quot;, &quot; &quot;, &quot;\u{0439}&quot;, &quot; &quot;, &quot;\u{0451}&quot;]
  printUnicodeScalars(&quot;à á ả ã ạ й ё&quot;)
  // à á ả ã ạ й ё -&gt; [&quot;a&quot;, &quot;\u{0300}&quot;, &quot; &quot;, &quot;a&quot;, &quot;\u{0301}&quot;, &quot; &quot;, &quot;a&quot;, &quot;\u{0309}&quot;, &quot; &quot;, &quot;a&quot;, &quot;\u{0303}&quot;, &quot; &quot;, &quot;a&quot;, &quot;\u{0323}&quot;, &quot; &quot;, &quot;\u{0438}&quot;, &quot;\u{0306}&quot;, &quot; &quot;, &quot;\u{0435}&quot;, &quot;\u{0308}&quot;]
  
  </code></pre>
  <p>I know that a diacritics character can in ASCII can be represented in different ways: like a single character, or like a combination of two: a letter and a diacritics.</p>
  <p>For some reason command line tool converts first variant into the second one. Probably that's because it's limited to UTF-8.</p>
  <p>How can I convert it back? Like to join many unicode-scalars character into a single one.</p>