title: MySQL won't maintain character information while importing
body: <p>I'm trying to import a large SQL file; created by mysqldump on one server, then converted with iconv; using these commands:</p>
  
  <pre><code>$ mysqldump -uxxx -p xxx &gt; data.sql
  $ iconv -f UTF-8 -t ISO-8859-1//TRANSLIT data.sql data.iconv.sql
  </code></pre>
  
  <p>I noticed that the "\x91" in the database had turned into "\xc3\x82\xc2\x91" in the dump, because mysqldump tries to convert everything to utf-8. I converted it back to "\x91" with iconv. If I do not convert them, they end up being "\xc2\x3f" on the new server; instead of just "\x3f" as we have now.</p>
  
  <p>So, as read before, there are some characters unique to the cp1252 encoding, for example "\x91" and "\x92". Both these characters have turned to "\x3f" in the new database; this is the command I use to import:</p>
  
  <pre><code>$ /opt/mysql5/bin/mysql -uxxx -p -Dxxx &lt; data.iconv.sql 
  </code></pre>
  
  <p>Anybody knows how this could happen and what to do to prevent it? Knowing this I should be able to migrate data exactly as it was.</p>
  
  <p>Extra information:</p>
  
  <p>I used <a href="http://www.outofcontrol.ca/2006/05/31/mysql-exportimport-and-charset-problems/" rel="nofollow noreferrer">this source</a> for the iconv-things. As you can see, on this page one other person had troubles with cp1252 as well; maybe that's the cause.</p>
  
  <p>The serverversion are:</p>
  
  <p>old-host: Ver 10.10 Distrib 5.0.18, for pc-linux-gnu (i486)
  new-host: Ver 10.11 Distrib 5.0.51, for pc-linux-gnu (i686)</p>