title: Why does server break utf-8 characters from DB?
body: <p>Remote server: CentOS 7/ Apache 2.4 / PHP 7/ MYSQL 5.7</p>
  
  <p>Everything works well when I run my php web application on local server, connecting to remote DB, but when I launch it on remote Apache/PHP, I see that special utf-8 chars are broken.</p>
  
  <p>I wonder why it is happening only when PHP is running on VDS? </p>
  
  <p>I use PDO_MYSQL and now see that ;charset=utf8  in DSN has solved the problem. But on my local PC I don;t need it in DSN. Why? How can I set utf 8 by default on remote server/PHP?</p>
  
  <p>I have this in my.cnf:</p>
  
  <pre><code>[mysqld]
  
  ... 
  
  log-error=/var/log/mysqld.log
  pid-file=/var/run/mysqld/mysqld.pid
  
  init_connect=‘SET collation_connection = utf8_unicode_ci’
  character-set-server = utf8
  collation-server = utf8_unicode_ci
  
  [client]
  default-character-set = utf8
  </code></pre>
  
  <p>But as far as I understand the problem is not with MySQL... is it?</p>