I ran into a charset problem. I am developing an application that uses a SQL Server database. The database was not created for this application, it exists and works very well. I can’t change anything in the database because it is too large and is used by many other applications.
I finished auth of my laravel 5 application, so I will create a view and show the name of the registered user in this view. Title: ADMINISTRADOR DA ACENTUAÇÃO. It uses some special characters.
In my opinion:
{!!Auth::user()->name!!}
He shows:
ADMINISTRADOR DA ACENTUA O
But in my controller, before I get back, I did:
die(\Auth::user()->name);
and he shows me:
ADMINISTRADOR DA ACENTUAÇÃO
I am trying to do this in my view file:
{!!Auth::user()->name!!} <?php die();
And it works great. This shows me:
ADMINISTRADOR DA ACENTUAÇÃO
This makes me believe that the occours error for something laravel makes after looking at it.
I do not know why this works well when I die on behalf of the user on the controller, but does not work when I echo his name on the view.
Can anybody help me?
PS:
- My view file uses utf8 charset
- I tried to echo using html tags and metaphorical characters without them. The problem occurs in both cases.
- I tried to delete my view file and create a new one using utf8 charset. This does not work.
- I tried using t23 tags instead of tags. This does not work.
php utf-8 character-encoding laravel laravel-5
Anderson silva
source share