Answer the question
In order to leave comments, you need to log in
Encoding problem on Ubuntu?
Comrades, good day!
I wrote a site on openserver under windows, but I decided to try the LAMP stack, installed Ubuntu 18.04, set it up to the best of my ability, launched the site and there was a problem with the encoding.
On one of the pages of the site, instead of the Cyrillic alphabet, it displays "??????????"
These categories are pulled from the database.
Tell me where to dig?
Answer the question
In order to leave comments, you need to log in
The problem was in the DB connection class constructor, forgot the bold line:
private function __construct ()
{
$dsn = 'mysql:host=' . self::HOST_DB . ';dbname=' . self::NAME_DB . ';charset=utf8';
$this->_instance = new PDO ($dsn, self::LOGIN_DB, self::PASS_DB);
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question