fogley's avatar

Special characters will not print

When I fetch text data from my SQLite DB with special characters (ä), the string containing the character has the character b prefixed to the string, dd'ing the data looks like this:

"column_name" => b"text containing ä

This doesn't print anything when printed in views like so:

{{ $object->column_name }}

Any fixes?

0 likes
1 reply
D9705996's avatar

This certainly looks related to the SQLite. You might be able to try adding this following to your boot method of app/Providers/AppServiceProvider.php

\Illuminate\Support\Facades\Blade::setEchoFormat('e(utf8_encode(%s))');

https://laravel.com/api/5.7/Illuminate/View/Compilers/BladeCompiler.html#method_setEchoFormat

If that doesn't work you might find some ideas here

https://stackoverflow.com/questions/34458520/laravel-eloquent-not-receiving-accented-characters-from-sqlite-database

Alterantively use Mysql ?

Please or to participate in this conversation.