When in in a text-area I write words with acceted letters ....the application store the words in mysql with some errors
E.g. if i write può
in my sql I have può
How can i solve it?
When in in a text-area I write words with acceted letters ....the application store the words in mysql with some errors
E.g. if i write può
in my sql I have può
How can i solve it?
To change an existing table to use the UTF-8 charset:
ALTER TABLE tablename CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci;
To set the default charset of the database to UTF8 for tables you will create in the future:
ALTER DATABASE databasename CHARACTER SET utf8 COLLATE utf8_unicode_ci;
You can use either utf8_general_ci
or utf8_unicode_ci
. It is explained at What's the difference between utf8_general_ci and utf8_unicode_ci that there is a difference between them in the speed and accuracy of the sorting, with utf8_unicode_ci
being more accurate and the performance gain of using utf8_general_ci
being very minimal.
(Also, be aware, when you are doing queries in the mysql console in the command prompt, it will not display as UTF-8 even when it is stored properly. Its a limitation of the command prompt.)