title: iconv() transliteration detected illegal character
body: <p>I have run into a strange situation while using PHP's <a href="http://php.net/manual/en/book.iconv.php" rel="nofollow"><code>iconv()</code></a> function. I have a MySQL database which contains several records that have French (and other European languages) characters within them. For example:</p>
  
  <pre><code>Saint-Côme-du-Mont
  </code></pre>
  
  <p>I am trying to write a function to convert these to friendly URLs, and turned to <code>iconv()</code>. The problem is that if I use the transliteration feature, I get the following error:</p>
  
  <pre><code>Notice: iconv(): Detected an illegal character in input string in...
  </code></pre>
  
  <p>The code generating the problem  is:</p>
  
  <pre><code>$url = iconv("utf-8", "us-ascii//TRANSLIT", $string); // TRANSLIT does the whole job
  </code></pre>
  
  <p>However, if I use <code>//IGNORE</code>, I get the following output:</p>
  
  <pre><code>Saint-Cme-du-Mont 
  </code></pre>
  
  <p>The field in the MySQL uses `` collation, and is stored as plain text. I've tried using <code>utf8_encode()</code>, but the same behaviour is present.</p>
  
  <p>If I use <code>mb_detect_encoding()</code> on the input string, I get <code>UTF-8</code>, so it seems to be receiving a string in the correct format.</p>
  
  <p>How can I circumvent the Notice, and still carry out the translit operation?</p>