title: Encoding error with polish charset during transfer of database / server seting up
body: <p>I am trying to transfer one of my databases from one host (home.pl) to another (my newly set server). The script that I am trying to transfer is wordpress. Unluckily irrespective of the method used I am struggling with encoding problems. </p>
  
  <p><strong>New host configuration</strong></p>
  
  <p>In my new server I am using the following directives in my.cnf:</p>
  
  <pre><code>[mysql]
  default-character-set=utf8
  
  [mysqld]
  collation-server = utf8_general_ci
  character-set-server = utf8
  init_connect='SET collation_connection = utf8_general_ci' 
  init_connect='SET NAMES utf8' 
  
  [client]
  default-character-set=utf8
  </code></pre>
  
  <p>My mySQL vars:</p>
  
  <pre><code>character_set_client    utf8
  character_set_connection    utf8
  character_set_database  utf8
  character_set_filesystem    binary
  character_set_results   utf8
  character_set_server    utf8
  character_set_system    utf8
  collation_connection    utf8_general_ci
  collation_database  utf8_general_ci
  collation_server    utf8_general_ci
  </code></pre>
  
  <p>Php.ini on new server:</p>
  
  <pre><code>; PHP's default character set is set to UTF-8.
  ; http://php.net/default-charset
  default_charset = "UTF-8"
  </code></pre>
  
  <p><strong>Old host configuration</strong></p>
  
  <p>I have runned SHOW VARIABLES in my old host from which I am trying to transfer database and I got the following:</p>
  
  <pre><code>character_set_client    utf8
  character_set_connection    utf8mb4
  character_set_database  utf8
  character_set_results   utf8
  character_set_server    latin2
  character_set_system    utf8
  /usr/local/pssql55/share/charsets/
  collation_connection    utf8mb4_general_ci
  collation_database  utf8_polish_ci
  collation_server    latin2_general_ci
  </code></pre>
  
  <p><strong>Transfer methods tried out</strong></p>
  
  <p>1) Transfer via phpmyadmin</p>
  
  <p>I have tried using PHPMYADMIN export/import. In particular I have pointed out UTF-8 as file character set both during export and import via phpmyadmin. </p>
  
  <p>What is strange both in phpmyadmin on source server and new host I don't see polish chars (the output is the same without polish chars).</p>
  
  <p>2) Export / Import via mysql dump</p>
  
  <p>I have tried also to use:</p>
  
  <pre><code> mysqldump -h OLD_HOST -u OLD_USER -p DB | mysql -h localhost -u root NEW DATABASE
  </code></pre>
  
  <p>but the encoding also fails.</p>
  
  <p>Tried to use also encoding variables but it also failed:</p>
  
  <pre><code> mysqldump --default-character-set=latin1  | mysql --default-character-set=utf8 
  </code></pre>
  
  <p><strong>Dump file</strong></p>
  
  <p>In my dump file using Programers Notepad with UTF-8 encoding set,  charcters look like this:</p>
  
  <pre><code>"Ä" instead of "ę"
  </code></pre>
  
  <p>Opening them in microsoft word I see</p>
  
  <pre><code>Ä™ instead of "ę"
  </code></pre>
  
  <p>The encoding converter (gżegżółka) recognises that the file is in:
  C:\Users\mkondej001\Desktop\14271425_mk.sql</p>
  
  <pre><code>Kodowanie: Unicode UTF-8
  EOL: LF (Unix) 
  </code></pre>
  
  <p><strong>Any clues how to transfer DB / set server variables correctly ?</strong> </p>