I'am trying to get some entries from a Database which need UTF-8 encoded text. But the text gets only shown as スーパーサンダーブレード.
At the moment the method to get the stuff from my Database is the following code:
public function getDetails($title){
$result = DB::select('SELECT * FROM `table` WHERE `title` = ?', [$title]);
return view('details', ['details' => $result]);
}
The code of my view is:
@foreach ($details as $detail)
<li>{{ $detail->text }} </li>
@endforeach
I tried to override the echo function of Blade with the following stuff inside the AppServiceProvider:
Blade::setEchoFormat('e(utf8_encode(%s))');
I made sure that my documents are UTF-8 and the <head>of the View contains <meta charset="utf-8">, my db-tables are also UTF-8 and I tried to make a simple PHP-File to query the DB via mysqliand the results are fine. Hardwritten special chars inside the view are no problem, either.
Any other things to look after or try?
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire