Urgent! Restore the backup: utf8 or latin1
Posted by: Dinh Pham
Date: December 06, 2005 03:27AM

I had a SimpleMachines forum up and running until my server was under DDOS attack. Unfortunately, after that the partition table was corrupted and it seems that there is no hope to restore.

Before that incident, I have backed up my database throught DirectAdmin interface that I think it use mysqldump as usual.

After restoring the database, the forum is up and running again but some of character (utf8) is not displayed correctly like before the incident.

I know that all of the data of my forum is stored in latin1-based table but almost my data is utf8 encoded. I read somewhere and learn that in the database that single utf8 character is encoded as three latin1 characters.

By exploring the database backup file (which is a zipped file, gz format, that contains a text file without file extention), the text file is encoded in utf8. I learn that by opening it in Editplus and use Save As. Of cource, I do not save it in that manner. I use that option to find out what it is encoded. In the backup file, I found that the table take default charset latin1.

I guess that as I dump the database, mysqldump set charset default to utf8. This means that she believes my database data is ALREADY in utf8 so it dumps in a utf8 file. Do you think it dumps database wrongly?

Therefore, I can not import my backup as usual to make the utf8 data displayed correctly. I try to ask my hosting company to restore my dabase in default charset = latin1 but the problem resists.

How can I resolve that problem? How can I import a utf-8 file that contains latin1 characters encoded incorrectly as utf8 ones to make my forum work as previous times.

I use MySQL 4.1
DirectAdmin, instead of CPanel
SimpleMachines 1.1RC1


character_set_client utf8
character_set_connection utf8
character_set_database latin1
character_set_results utf8
character_set_server latin1
character_set_system utf8
character_sets_dir /usr/share/mysql/charsets/
collation_connection utf8_general_ci
collation_database latin1_swedish_ci
collation_server latin1_swedish_ci

Thanks a lot


Options: ReplyQuote

Written By
Urgent! Restore the backup: utf8 or latin1
December 06, 2005 03:27AM

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.