V
V
Vlad Gromov2019-09-07 01:09:15
LAMP
Vlad Gromov, 2019-09-07 01:09:15

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 "??????????"
5d72d81167b0d953909520.png
These categories are pulled from the database.
5d72d8a2b878d420360363.png
Tell me where to dig?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vlad Gromov, 2019-09-07
@Vikkiners

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 question

Ask a Question

731 491 924 answers to any question