Re: Cannot get mysqldump to produce utf-8 encoded files!
Posted by:
Erik Alm
Date: July 28, 2007 07:20AM
Hello,
This is how I solved this problem.
First I set the char-sets dir (which I believe shouldn't be needed since mysqldump complained when I didn't use a name from the Index.xml in that dir)... anyway I set it like this:
--character-sets-dir=/usr/share/mysql/charsets
Second off, I found using the "utf8" charset did not do the trick (don't ask me why) by instead using "latin1" like this:
--default-character-set=latin1
I managed to make special characters display correctly.
If I do "file -in" on one of the files (thanks for the tip by the way!) I get:
$ file -in gallery2.sql
gallery2.sql: text/plain; charset=utf-8
So I guess you can have utf8 output even when using "latin1" in mysql-speak...
I also guess you should go through /usr/share/mysql/charsets/Index.xml to find your language/country and its corresponding char-set. God help you if you try to store data in more than one language ... or something :S
Finally I need to point out that aside from manually checking the file for special chars I've done no restore test of any kind (simply because I wanted to get backups up and running before doing anything with the database... I guess that should include restore testing as well... oh well...)
HTH
/E
Subject
Views
Written By
Posted
14803
December 06, 2006 02:39AM
6341
May 03, 2007 06:09AM
Re: Cannot get mysqldump to produce utf-8 encoded files!
10703
July 28, 2007 07:20AM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.