title: Weird utf8 conversion problem in php
body: <p>So I'm working on a project that is taking data from a file, in the file some lines require utf8 symbols but are encoded oddly, they are \xC6 for example rather than being \&#xC6;</p>
  
  <p>If I do as follows:</p>
  
  <pre><code>$name = "\xC6ther";
  $name = preg_replace('/x([a-fA-F0-9]{2})/', '&amp;#$1;', $name);
  echo utf8_encode($name);
  </code></pre>
  
  <p>It works fine. I get this:</p>
  
  <pre><code>Æther
  </code></pre>
  
  <p>But if I pull the same data from MySQL, and do as follows:</p>
  
  <pre><code>$name = $row['OracleName'];
  $name = preg_replace('/x([a-fA-F0-9]{2})/', '\&amp;#$1;', $name);
  $name = utf8_encode($name);
  </code></pre>
  
  <p>Then I receive this as output:</p>
  
  <pre><code>\&amp;#C6;ther
  </code></pre>
  
  <p>Anyone know why this is?</p>
  
  <p>As requested, vardump of $row['OracleName'];</p>
  
  <pre><code>string(15) "xC6ther Barrier" 
  </code></pre>