title: Converting Unicode to ASCII
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/138449/how-to-convert-a-unicode-character-to-its-ascii-equivalent">How to convert a Unicode character to its ASCII equivalent</a><br>
    <a href="https://stackoverflow.com/questions/249087/how-do-i-remove-diacritics-accents-from-a-string-in-net">How do I remove diacritics (accents) from a string in .NET?</a><br>
    <a href="https://stackoverflow.com/questions/2624646/convert-unicode-char-to-closest-most-similar-char-in-ascii-net">Convert Unicode char to closest (most similar) char in ASCII (.NET)</a>  </p>
  </blockquote>
  
  
  
  <p>I'll be taking in names that won't necessarily be English and need to convert them to their basic counterparts. I.e. Transliteration é to e</p>
  
  <p>I don't have to worry about converting for example Japanese to english letters.</p>
  
  <p>Is there any way to do this?</p>
  
  <p>Thanks</p>
  
  <p>Answer:</p>
  
  <pre><code>public void ConvertDiacritic()
      {
          nameInFull = nameInFull.Normalize(NormalizationForm.FormD);
          StringBuilder sb = new StringBuilder();
          for (int i = 0; i &lt; nameInFull.Length; i++)
          {
              UnicodeCategory uc = CharUnicodeInfo.GetUnicodeCategory(nameInFull[i]);
              if (uc != UnicodeCategory.NonSpacingMark)
              {
                  sb.Append(nameInFull[i]);
              }
          }
          nameInFull = sb.ToString().Normalize(NormalizationForm.FormC);
      }
  </code></pre>