Hello.

There is a database with utf8_general_ci encoding. There is a php page with utf-8 meta tag.

But for some reason, the Russian text is in fucking coding, and not all, but one that is taken from the database. You can help?

http://likebox.ru/fbtn/

    2 answers 2

    The file should also be utf-8 encoded, check it in Notepad ++, and transcode if necessary (without Bom)

    • Then I think that it's in the database, you have utf8_unicode_ci, and you need utf8_general_ci. Another option is to add a line to the beginning of the file: header ('Content-Type: text / html; charset = utf-8'); and in the .htaccess file line: AddDefaultCharset utf-8 - Andrey Arshinov
    • utf8_general_ci and .htaccess - did not produce results. Maybe when writing to the database is written in hell understand what. How to convert a string to utf-8 before writing? - butteff 2:57 pm
    • one
      It helped, thanks! - butteff
    • one
      Thank God) - Andrei Arshinov

    And with mySQL you need to add

    mysql_query(”SET NAMES 'utf8′”); mysql_query(”SET collation_connection='utf8_general_ci'”); mysql_query(”SET collation_server='utf8_general_ci'”); mysql_query(”SET character_set_client='utf8′”); mysql_query(”SET character_set_connection='utf8′”); mysql_query(”SET character_set_results='utf8′”); mysql_query(”SET character_set_server='utf8′”); 
    • There is no need for the last lines, because mysql_query (”SET NAMES 'utf8 ′”); performs all these operations. - Andrey Arshinov