title: C# Map all possible characters to the alphabet
body: <p>I'm trying to map all possible letters to the letters A-Z, # for numbers and maybe &amp; for other characters.
  For that I'm using the <code>Normalize(NormalizationForm)</code> method.
  That gets rid of most of the unwanted characters like characters with accents and so on.</p>
  
  <p>However it doesn't deal with duplicates. It seems like the letter M is located in more than one position and therefore the equal-check fails.</p>
  
  <p>Here's my code that checks every possible letter:</p>
  
  <pre><code>for (uint i = char.MinValue; i &lt;= char.MaxValue; i++)
  {
      char normalizedChar = char.ToUpper($"{(char)i}".Normalize(System.Text.NormalizationForm.FormKD).FirstOrDefault());
      if (Char.IsLetter((char)i) &amp;&amp; !allowedLetters.Contains(normalizedChar))
          throw new Exception();
  }
  </code></pre>
  
  <p>Where allowedLetters is a char array containing all letters of the alphabet and '#'.</p>
  
  <p>It fails at i = 181 which is normalized 924 = 'M' just like 77 = 'M'.</p>
  
  <p>I'm also open for better ways to normalize a character since the only method I could find only works on strings.</p>