Accents in session flash de laravel 5.2

0

It turns out that I am sending messages to the views, through the class Session and its method flash documentation: Session-> Flash

But at the moment of sending an accent, in the view it brings me the code as if it did not have the utf-8 configured. And my HTML page if you have that configured.

I suspect that it is laravel or PHP, which apparently is not configured with utf-8.

And my question if anyone knows what is the best way to solve this problem?

Greetings.

    
asked by Luis Enrque Plata Osorio 13.04.2017 в 16:40
source

1 answer

0

If the error only occurs when you make queries from your database check that the collation of your database and its tables are in utf-8 .

Also in the database.php file you must have the utf-8 configured:

'mysql' => [ 'driver' => 'mysql', 'host' => env('DB_HOST', 'localhost'), 'database' => env('DB_DATABASE', 'forge'), 'username' => env('DB_USERNAME', 'forge'), 'password' => env('DB_PASSWORD', ''), 'charset' => 'utf8', 'collation' => 'utf8_unicode_ci', 'prefix' => '', 'strict' => false, ],

Another option could also be to use the php function utf8_encode () .

Also check that everything is well written sometimes we can miss a letter.

Finally, check that your text editor is configured in utf-8.

    
answered by 15.04.2017 в 07:18