I use the PDO library with a MySQL database in PHP, but if I insert any data encoded in UTF-8, like Arabic words, it’s inserted into the database, but as ?????????
?????????
Try setting the default_charset value in php.ini to UTF-8. Or you can set it using the ini_set function.
default_charset
Also, if the input is coming through form submissions, make sure your web pages are set to UTF-8 using the meta tag.