Answer the question
In order to leave comments, you need to log in
What encoding does PDO use?
Thanks in advance.
Recently started using PDO to work with MySQL. And immediately a problem. If everything is requested and added via php, then it's fine. But if you look in phpmyadmin or mysql workbench, then there are hieroglyphs.
this is how php shows it. And adds what you need. But this is how phpmyadmin shows
Answer the question
In order to leave comments, you need to log in
You need to add an entry in the server settings.
for example CentOS /etc/httpd/conf.d/ your config
https://developer.mozilla.org/en-US/docs/Web/HTTP/...
Note: Setting the meta tag is useless! For instance, has no effect. Don't use it! Only by setting through the HTTP header like the examples below, X-Frame-Options will work.
I will translate a little for you "Installing the meta tag is useless!"
By default - none (the MySQL server will choose, most likely it will be latin1). Therefore, you need to manually prescribe the encoding either in the connection string, or for older versions of PHP (before 5.3.6 it seems) - the set names request, as usual.
Try creating a new db with phpmyadmin. When creating, specify Utf-8 general_ci encoding. Everything should be normal
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question