在mysql中更改文本编码

I had a mysql database in which I saved some special characters é , but in the database it was saved like this é, later on I realised that it is due to the encoding and I changed the encoding scheme for my table and DB to UTF-8 but the text already inserted in it didn't changed,

My question is

  • Is there a way to automatically change all the content to 'obey' UTF-8 .
  • Is there a way that I can alteast update é to é?

NOTE: I know about the update command , but I dont think that will help here with characters with in the field.

I had some similar problems.

You need to set the encoding to utf-8 in:

  • the html or php file
  • the database column
  • and the database connection

From what you have said you already set the encoding in the database column.

To change the database connection use mysqli_set_charset ($conn, 'UTF-8');

If all of these are set to UTF-8 the data should display correctly.