I created MySQL database, but I can see only question marks instead of Russian text on the website. Why?
  ru en
Help
Print version

I created MySQL database, but I can see only question marks instead of Russian text on the website. Why?

Make sure that the database encoding and connection settings to the database from your scripts correspond to the data encoding stored in the database.

To change DB encoding to the required one (e.g.: cp1251) the following SQL command shall be executed:
ALTER DATABASE [db_name] CHARACTER SET=cp1251;

During connection, for example, from PHP after connection to the database it shall be necessary to set encoding in which you want to receive the text from the database; usually, it is sufficient to insert the following line after mysql_connect (or similar) command:
mysql_query("SET NAMES 'cp1251' ");

Besides, it shall be necessary to make sure that encoding of the dump being uploaded to the hosting is correct, that the data match this encoding and that you have selected correct encoding at performing import operation.

Copyright © 2000-2024 Registrar R01
Information: info@r01.ru
Support: support@r01.ru
Office: 1 Bolshoy Gnezdnikovsky Lane, building 2, Moscow (Tverskaya metro station, entrance No. 9, Voznesensky business center)