I create websites using my own PHP engine developed around 2007, which has since gone through all sorts of modifications and improvements. The encoding remained the same – windows-1251. Should I switch to UTF-8? Almost all Russian and foreign websites use UTF-8 encoding.
What is the advantage of UTF-8 encoding over windows-1251, and is there any advantage at all?
And another question, please tell me how to correctly switch to UTF-8, including the MySQL database?
- Make a complete dump of the database, including the structure of the tables, in the old encoding.
- Recode all pages of the site and a copy of the dump in UTF-8.
- Change the default database encoding to UTF-8, comparison to
utf8_general_ci. Delete all tables.
- Upload the dump to UTF-8, specifying the encoding.
- Of course, change the encoding to utf-8 in the headers of all pages on the site.
@mountpoint already said about the advantages of unicode.