Answer the question
In order to leave comments, you need to log in
What's wrong with encoding?
The database is set to utf-8 encoding, the site is the same. I write down in a DB from a text field the data in Russian. I see unreadable characters in the database. Tried to add before executing the query:
mysqli_query($mysqli, "SET NAMES 'utf8' COLLATE 'utf8_general_ci'");
Answer the question
In order to leave comments, you need to log in
By default mysql server uses latin1 encoding.
If I'm not confusing anything, then the request that came from you in utf8 is converted to latin1, and then the resulting abracadabra (normally utf8 is not converted to latin1) is converted back to utf8. The output is garbage.
Adding to my.cnf
collation-server = utf8_general_ci
character-set-server = utf8
there is a site encoding, a database encoding, and a client encoding. What do you have written in my.ini?
sorry, in my.cnf, in [client]
the encoding is usually set immediately after the connection to the database...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question