I'm facing a charset problem here. I'm developing an app that uses a sql server database. The database was not created for this app, it exists before it and works very well. I can't change anything on the database because its too large and its used by many other apps.
I've been finished the auth of my laravel 5 app, so I'll create a view and show in this view the name of logged user. The name is: ADMINISTRADOR DA ACENTUA??O. It use some special characters.
In my views:
{!!Auth::user()->name!!}
it shows:
ADMINISTRADOR DA ACENTUA??O
But in my controller, before I return the view, I did:
die(Auth::user()->name);
and it shows me:
ADMINISTRADOR DA ACENTUA??O
I try now do it in my view file:
{!!Auth::user()->name!!}
<?php die();
And this works fine. It shows me:
ADMINISTRADOR DA ACENTUA??O
It makes me believe the error occours for something laravel does after the views are parsed.
I don't know why it works well when I die the user name on the controller, but not works when I echo its name on the view.
May anyone help me plz?
PS:
- My view file is using utf8 charset
- I tried to echo with and without html tags and charset meta. The problem occours on both cases
- I tried to delete my view file and create a new one with utf8 charset. It doesn't work.
- I tried to use
<?php echo Auth::user()->name; ?>
instead blade tags. It doesn't work.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…