This DDL that you talked about is about sorting, not a character set. Correct statement:
ALTER TABLE Clients CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
You still need to make sure that the client library (libmysql or any other PHP driver) does not encode data back to ISO-8859. mysql_set_charset ('utf8') will explicitly set the client encoding to UTF-8. Alternatively, you can send SET NAMES UTF8; immediately after connecting to the database. To do this implicitly, you can modify the my.cnf [client] block to have utf-8 as the character encoding of the client (and / etc / init.d / mysql reload to apply). In any case, make sure that the client does not distort the results that he pulls.
[client] default-character-set = utf8
You do not need to use utf8_decode if you use mbstrings. The following php.ini configuration should provide UTF-8 support on the PHP side:
mbstring.internal_encoding = utf-8 mbstring.http_output = utf-8 mbstring.func_overload = 6
Finally, when you display the results in HTML, make sure the page encoding is explicitly UTF-8.
source share