I have a project where users are supposed to use special characters (cyrillic like ‘Врати се на почетак’ which means return to top for example). I will have to make some special settings and I need some advice regarding the proper encoding to use for my project:
- mysql database – is it good to use this encoding
utf8_unicode_cior should I search to a specific one? (I did not find anything dedicated to cyrillic languages, but this review says it is ok to use this http://forums.mysql.com/read.php?103,187048,188748#msg-188748) - php – will this setting
mysql_query("SET NAMES 'utf8'");be enough in php to parse correctly the mysql query response in my code? - html headers – would this header
<META http-equiv="content-type" content="text/html; charset=windows-1251">suffice for the correct display and interpretation for both browsers and crowlers for my page?
Is there anything else I should be aware of in this issue?
Thank you!
UTF-8 is the better solution for Cyrillic chars in web. But you have to change this:
to
And of course the source files must be saved with urf-8 enc set.
PS: If you are setting everything in utf8 there is no need of calling
mysql_query("SET NAMES 'utf8'");Its necessary only if you have inherited project with db in other encoding/converting old databases is sometimes nightmare/