Answer the question
In order to leave comments, you need to log in
How to solve output encoding problems?
Greetings.
This is a continuation of the question Encoding problems
In the previous question, we have already figured it out and got:
1. Base in utf
2. Data written in utf (including Cyrillic displayed correctly)
3. Encoding when accessing the database - utf
What was my surprise when after such a triumph, the select wardump from the database issued: �����������
mb_detect_encoding data from the database showed that it was UTF-8. But, damn it, how is that?!
Structure screen:
Data screen : Database
connection:
$app->register(new Silex\Provider\DoctrineServiceProvider(), array(
'dbs.options' => array(
'local' => array(
'driver' => 'pdo_mysql',
'host' => 'localhost',
'dbname' => '***',
'user' => '***',
'password' => '***',
'charset' => 'utf8',
),
$con = mysqli_connect("***");
mysqli_query($con, "SET NAMES 'utf8';");
mysqli_query($con, "SET CHARACTER SET 'utf8';");
mysqli_query($con, "SET SESSION collation_connection = 'utf8_general_ci';");
mysqli_query($con,"INSERT INTO api_response (response) VALUES ('" . $response . "')");
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question