Support the ongoing development of Laravel.io →
Configuration Views Blade
Last updated 1 year ago.
0

Ensure your layout template starts something like this:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">

If the above is true, then does the "Österreich" come from the database? If that's the case, you need to ensure that your database encoding is also UTF-8.

Another point... If you use htmlentities to output data, make sure it looks like this:

htmlentities($str, ENT_QUOTES, "UTF-8");

Good luck.

Last updated 1 year ago.
0

Hy, also make sure that your IDE is creating your files with the current settings. Komodo edit drove me mad once on this, because it was creating the new files with the wrong charset.

Last updated 1 year ago.
0

Thx, but unfortunately nothing changed.

The sick thing is - the data out of the database is displayed correctly. Only the written text directly in the view file is the problem...

Last updated 1 year ago.
0

mrohrboeck said:

Thx, but unfortunately nothing changed.

The sick thing is - the data out of the database is displayed correctly. Only the written text directly in the view file is the problem...

That kinda points to it being a file encoding issue.

Download Notepad++ and open your files in it. On the top menu is "Encoding" - set this to "Encode in UTF-8 without BOM" and then save the files.

Last updated 1 year ago.
0

I know this is a super old thread, but I just had this issue also. Tried what sitesense said, but for me I had to "Convert to UTF-8 without BOM" ! Finally no more symbols! Thanks for the right direction!

0

I'm facing the same problem here. Is there a way to override the escape method from blade? I think blade is running htmlentities() in all my strings, but I must run htmlentities($striong, 'UTF-8') instead of. May anyone help me please?

0

Sorry for bumping up old thread but I am also experiencing problems with this! Would be awesome to find a solution!

I too have done the <meta> tag thing and also I've checked my texteditor which is not the problem and has never been the problem before either. Using notepad++ and sublime.

The closest I've gotten to an answer is Blade::setEchoFormat('e(utf8_encode(%s))') but I am not sure where to put this yet!

Last updated 8 years ago.
0

Jsal said:

Sorry for bumping up old thread but I am also experiencing problems with this! Would be awesome to find a solution!

I too have done the <meta> tag thing and also I've checked my texteditor which is not the problem and has never been the problem before either. Using notepad++ and sublime.

The closest I've gotten to an answer is Blade::setEchoFormat('e(utf8_encode(%s))') but I am not sure where to put this yet!

I believe you need to put

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

in your app/Providers/AppServiceProvider.php file, boot method.

I had this problem with a project that uses a pre-existing mssql database, and I was bumping my head over this. I ended up finding a solution that is to put:

'characterset' => 'utf8',

instead of 'charset'=>'utf8', in database.php file, in the corresponding connection (sqlsrv) (my database has a SQL_Latin1_General_CP1_CI_AS collation).

edited

I need to add, that I was trying to understand what actually worked to solve my issue, as I tried many things, so I undid all the 'solutions', and it's working neverthless, so I'm lost again...

Last updated 8 years ago.
0

My problem was solved by using:

\Blade::setEchoFormat('e(utf8_decode(%s))');

Last updated 7 years ago.
0

\Blade::setEchoFormat('e(utf8_decode(%s))'); use id in app/Providers/AppServiceProvider.php file, boot method.

0

\Blade::setEchoFormat('e(utf8_decode(%s))');

Not worked for me.

{{ trans('features.verify') }} should show Überprüfen but showing nothing

Please help

Last updated 6 years ago.
0

Bro if you are using PHPStorm try this: File / Settings/ Editor / File Encodings select "UTF-8" on IDE Encoding y Project Encoding.

That fixed the problem. No need of \Blade::setEchoFormat('e(utf8_decode(%s))'); in my case

garimagoyal said:

\Blade::setEchoFormat('e(utf8_decode(%s))');

Not worked for me.

{{ trans('features.verify') }} should show Überprüfen but showing nothing

Please help

0

I was experiencing the same problem with data from Sybase/SQLServer, and this worked for me:

  1. Configured utf8 as charset in database.cfg: ... 'charset' => 'utf8', 'collation' => 'bin_utf8', ...
  2. In the blade, encoded the parameters returned by my query: {{utf8_encode($param)}}
0

Sign in to participate in this thread!

Eventy

Your banner here too?

mrohrboeck mrohrboeck Joined 30 Jul 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.