title: Issues replacing special characters in PHP string
body: <p>I'm trying to replace the special characters in a PHP string with normal characters (as in replace ó with o and á with a). I tried using the PHP Normalizer::normalize function as in the following code:</p>
  
  <pre><code>if (!Normalizer::isNormalized($word, Normalizer::FORM_C))
  {
      echo "original: ".$word;
      $word = Normalizer::normalize($word, Normalizer::FORM_C);
  
      echo "\tnormalized: ".$word."&lt;br /&gt;";
      exit; // see if it worked without having to go through every file
  }
  </code></pre>
  
  <p>However, Normalizer::normalize returned null and the output from that code was: </p>
  
  <p><code>original: adiós    normalized:</code></p>
  
  <p>Since this method didn't seem to be working, I went and found a function that was supposed to remove special characters. Here is the function:</p>
  
  <pre><code>function normalize ($string) {
      $table = array(
          'Š'=&gt;'S', 'š'=&gt;'s', 'Đ'=&gt;'Dj', 'đ'=&gt;'dj', 'Ž'=&gt;'Z', 'ž'=&gt;'z', 'Č'=&gt;'C', 'č'=&gt;'c', 'Ć'=&gt;'C', 'ć'=&gt;'c',
          'À'=&gt;'A', 'Á'=&gt;'A', 'Â'=&gt;'A', 'Ã'=&gt;'A', 'Ä'=&gt;'A', 'Å'=&gt;'A', 'Æ'=&gt;'A', 'Ç'=&gt;'C', 'È'=&gt;'E', 'É'=&gt;'E',
          'Ê'=&gt;'E', 'Ë'=&gt;'E', 'Ì'=&gt;'I', 'Í'=&gt;'I', 'Î'=&gt;'I', 'Ï'=&gt;'I', 'Ñ'=&gt;'N', 'Ò'=&gt;'O', 'Ó'=&gt;'O', 'Ô'=&gt;'O',
          'Õ'=&gt;'O', 'Ö'=&gt;'O', 'Ø'=&gt;'O', 'Ù'=&gt;'U', 'Ú'=&gt;'U', 'Û'=&gt;'U', 'Ü'=&gt;'U', 'Ý'=&gt;'Y', 'Þ'=&gt;'B', 'ß'=&gt;'Ss',
          'à'=&gt;'a', 'á'=&gt;'a', 'â'=&gt;'a', 'ã'=&gt;'a', 'ä'=&gt;'a', 'å'=&gt;'a', 'æ'=&gt;'a', 'ç'=&gt;'c', 'è'=&gt;'e', 'é'=&gt;'e',
          'ê'=&gt;'e', 'ë'=&gt;'e', 'ì'=&gt;'i', 'í'=&gt;'i', 'î'=&gt;'i', 'ï'=&gt;'i', 'ð'=&gt;'o', 'ñ'=&gt;'n', 'ò'=&gt;'o', 'ó'=&gt;'o',
          'ô'=&gt;'o', 'õ'=&gt;'o', 'ö'=&gt;'o', 'ø'=&gt;'o', 'ù'=&gt;'u', 'ú'=&gt;'u', 'û'=&gt;'u', 'ý'=&gt;'y', 'ý'=&gt;'y', 'þ'=&gt;'b',
          'ÿ'=&gt;'y', 'Ŕ'=&gt;'R', 'ŕ'=&gt;'r',
      );
  
      return strtr($string, $table);
  }
  </code></pre>
  
  <p>This code had no noticeable effect, however, and returned the same string that was passed in.</p>
  
  <p>I'm obtaining my strings from *.txt files in Windows 7. I've never been very good at encodings, and would appreciate any help on this issue.</p>