title: How to get an "English name" for a character?
body: <p>I was just using this most helpful link: <a href="https://stackoverflow.com/questions/62771/how-check-if-given-string-is-legal-allowed-file-name-under-windows">How do I check if a given string is a legal / valid file name under Windows?</a></p>
  
  <p>And inside some validate code I have something that looks like (ignore the fact that I'm not using a StringBuilder class and ignore the bug in forming the message (don't need to tell them about 'Colon' more than once if it shows up in the string more than once)):</p>
  
  <pre><code>string InvalidFileNameChars = new string(Path.GetInvalidFileNameChars());
  Regex ContainsABadChar = new Regex("[" + Regex.Escape(InvalidFileNameChars) + "]");
  
  MatchCollection BadChars = ContainsABadChar.Matches(txtFileName.Text);
  if (BadChars.Count &gt; 0)
  {
      string Msg = "The following invalid characters were detected:\r\n\r\n";
      foreach (Match Bad in BadChars)
      {
          Msg += Bad.Value + "\r\n";
      }
      MessageBox.Show(Msg, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
      return;
  }
  </code></pre>
  
  <p>That MessageBox will look something like (using the example that a colon was found):</p>
  
  <p>-- begin --</p>
  
  <p>The following invalid characters are detected:</p>
  
  <p>:</p>
  
  <p>-- end --</p>
  
  <p>I'd like it to say something like:</p>
  
  <p>-- begin --</p>
  
  <p>The following invalid characters are detected:</p>
  
  <p>Colon -> :</p>
  
  <p>-- end --</p>
  
  <p>I like having the english name.  Not a killer, but was curious if there's some function out there like (which doesn't exist for the Char class, but may exist in some other class I'm not thinking of):</p>
  
  <p>Char.GetEnglishName(':');</p>