I'm trying to import a large SQL file; created by mysqldump on one server, then converted with iconv; using these commands:
$ mysqldump -uxxx -p xxx > data.sql
$ iconv -f UTF-8 -t ISO-8859-1//TRANSLIT data.sql data.iconv.sql
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.
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:
$ /opt/mysql5/bin/mysql -uxxx -p -Dxxx < data.iconv.sql
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.
Extra information:
I used this source 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.
The serverversion are:
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)