T
T
tvelforce2015-12-20 20:25:59
MySQL
tvelforce, 2015-12-20 20:25:59

How to fully set UTF-8 encoding on a website?

Good day. I'm trying to set the UTF-8 encoding on the site, but there are still hieroglyphs in the database.
I registered in the .htacces file
AddDefaultCharset UTF-8
When connecting to the database, I make a request

mysql_query("SET NAMES 'UTF-8'");
mysql_query("SET CHARACTER SET 'UTF-8'");

meta tag:
<meta charset="utf-8" />
All files on the hosting are converted to UTF8 without BOM
In Phpmyadmin set the encoding to UTF8 general_ci
12b1712b7f4d45598184679630b12851.png
comparison is the same.
8f33821157f2451fb1df698dbb7c79f3.png
only here it is not clear where it is
latin1_swedish_ci
and how to change it?
In general, no matter how hard I try, this is still in the database:
04d0b02bd0b94da28c0ca016577c4f11.png
I would be grateful for any help.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
K
Kirill Arutyunov, 2015-12-20
@tvelforce

In phpmyadmin go to the "Operations" section and make sure the database, table, table fields are all utf-8 encoded.
If not, then specify utf-8.
Then enter/edit data.
Make sure that the data sources (where the data comes from) are passing strings in UTF-8.

T
tvelforce, 2015-12-20
@tvelforce

I solved the problem:
When connecting to the database, I send a request:
And it was installed:

mysql_query("SET NAMES 'UTF-8'");
mysql_query("SET CHARACTER SET 'UTF-8'");

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question