I have a database in latin1 format, all the utf8 character stored are shown as ????
+------+---------+-------+---------+--------------------+----------+-------------------- -----+---------------------+---------------------+---------+
| id | user_id | fname | lname | designation | location | email | created_at | updated_at | country |
+------+---------+-------+---------+--------------------+----------+------------------------- +---------------------+---------------------+---------+
| 6035 | 6035 | ????? | ??????? | ???????? ????????? | | [email protected] | 2011-04-11 06:05:54 | 2011-04-10 06:13:04 | xxxxxxxxx |
+------+---------+-------+---------+--------------------+----------+-------------------------+---------------------+---------------------+---------+
Now I use this command and change the format of the database and the table to utf8
ALTER TABLE <table_name> CONVERT TO CHARACTER SET utf8;
ALTER DATABASE <database_name> CHARACTER SET utf8;
I have read that latin1 uses 1byte for every character but utf8 uses 3bytes for every character. My question is If i alter my table (Already containing lots of data) form latin1 to utf8, what will the old character data consume 3bytes or 1byte. If i use alter and convert the data will i have problem with the old data ? I am sure that new data will be in utf8.