Answer the question
In order to leave comments, you need to log in
Encoding, everywhere utf-8, in the database - krakozyabry, what should I do?
Server on locale on denver.
There is an interface for adding data to the database in PHP. At the beginning of the php page is the header('Content-Type: text/html; charset=utf-8');
entire database and table in utf-8
SHOW VARIABLES LIKE 'char%'
character_set_client
utf8
character_set_connection
utf8
character_set_database
utf8
character_set_filesystem
binary
character_set_results
utf8
character_set_server
utf8
character_set_system
utf8
character_sets_dir
\usr\local\mysql-5.5\share\charsets\
mysql_query("set names utf8");
AddDefaultCharset windows-1251
AddDefaultCharset utf-8
Answer the question
In order to leave comments, you need to log in
change the encoding in the program in which you view data from the database
using the database, look at what encoding the text in the cell is in
In my programs I use 2 lines.
Met cases when not enough only one.
mysql_query("SET NAMES utf8");
mysql_query("SET CHARACTER SET utf8");
I remember having this problem too. And everything happened due to the fact that one connected script was not in utf-8 encoding. Check the encodings of your scripts, there may be a problem in the client side, i.e. the data comes already in the wrong encoding.
I also advise you to add htaccess:
AddDefaultCharset UTF-8
I'm paranoid now, I make sure that everything is in utf-8 :-)
In general, as usual, I blunted and corrected the file with the connection in the backup folder, instead of the working one :(
mysql_set_charset('utf8', $conn);
or
mysql_query("SET NAMES 'utf8'");
it was quite enough for the goods to be added to the database in Russian , although the old goods are now displayed as krakozyabry, but it was all test)
thank you all, I apologize for wasting your time :)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question