title: utf8, utf8mb4, utf8_general_ci trouble on PDO retrieving data
body: <p>I've a db stored on a server that is encoded in</p>
  
  <blockquote>
    <p>utf8_general_ci</p>
  </blockquote>
  
  <p>All my pages are forced to be in </p>
  
  <blockquote>
    <p>utf8</p>
  </blockquote>
  
  <p>My connection to the db is like this:</p>
  
  <pre><code>return new PDO('mysql:host=localhost;dbname=XXXX',
              'XXXX', 'XXXX', array(PDO::MYSQL_ATTR_INIT_COMMAND =&gt; "SET NAMES utf8mb4",
                  PDO::MYSQL_ATTR_LOCAL_INFILE =&gt; true, PDO::ATTR_ERRMODE =&gt; PDO::ERRMODE_EXCEPTION));
  </code></pre>
  
  <p>But I even tried as option
      "SET NAMES utf8"</p>
  
  <p>When I try to parse my resultset I always had a problem with some text field, and if I try command likes:</p>
  
  <pre><code>            $originalEncoding = mb_detect_encoding($fieldWithProbs); 
  </code></pre>
  
  <p>returns to me </p>
  
  <blockquote>
    <p>ASCII</p>
  </blockquote>
  
  <p>and then if I trying to convert it with commands like:</p>
  
  <pre><code>                $newEncodedData = mb_convert_encoding($fieldWithProbs, 'UTF-8');
  </code></pre>
  
  <p>it doesn't seems to works and if I asking again the type of encoding is still in ASCII.
  The strange things is that works in local but not on the remote server with same type of encoding on db set.
  How can I solve this problem?</p>