Ashkan
Ashkan

Reputation: 169

French characters in MySQL database

I have a huge database of book authors in which names of French authors have not been stored correctly and the French characters have been replaced by some strange characters!

Can I solve the problem by a SQL query? if yes, I do appreciate if you give me a clue.

Thanks,

Upvotes: 5

Views: 3047

Answers (1)

Ray
Ray

Reputation: 41428

  1. Export your table data with a mysqldump
  2. Change the character encoding of the dump file create table statement to utf8
  3. drop the table or change the name to something like tablename_old (I recommend keeping the old table until after the experiment ;))
  4. Import the modified dump file

Since french characters are all in UTF8 and you probably don't have a multi-byte encoding character set on your table, this should fix the issue.

You might be able to just run an alter table to change the encoding, but in my experience that can be a roll of the dice.

Upvotes: 2

Related Questions