I have a problem with Lumen connection character encoding
I tried everything and I figured that the connection is the problem
In a lumen model, I created a new mysqli connection like this
$sql = "SELECT summary FROM exp_fb_assessments WHERE aid=8192";
$result = $conn->query($sql);
while($row = $result->fetch_assoc()) {
echo $row["summary"] . "<br>";
}
And right after that, I do this to see the output of the default DB
Lumen connection
$results = DB::select("SELECT summary FROM exp_fb_assessments WHERE aid=8192");
echo $results[0]->summary;
As you can see both are exactly the same but I get different results
Test 例如:发表 这篇论文 什么时候 是 的
这篇论文是什么时候发表的?
Test 例如:å‘表 这篇论文 什么时候 是 çš„
这篇论文是什么时候å‘表的?
How can I fix this or at least debug and find where the problem with the connection is.
NOTE: I tried setting these in my .env
file:
DB_CHARSET=utf8
DB_CHARACTERSET=ut8
DB_COLLATION=utf8_unicode_ci
still not working.