Search code examples
laravellaravel-bladelaravel-views

Laravel 5.1 Blade view output charset not working as expected


I have encountered a strange situation. After releasing the project to the release server some characters are not displaying correctly, however running the project on c9.io server works just fine.

For example:

This is what I'm seeing in c9.io c9.io

And this is what I see in the release. release

HTML's, databases and database configs have charset set to UTF-8

Snippet of the code used to list the elements in the blade template

<ul class="nav navbar-nav">
    @foreach($menu as $item)
          <li><a href="/{{$item[App::getLocale()]['url']}}">{{$item[App::getLocale()]['name']}}</a></li>
     @endforeach
</ul>

As I can see, the š character displays correctly, any ideas why would this happen? Maybe there is a config I missed? This occurs in any {{ $variable }} output throughout the project.

This answer did not fix my problem


Solution

  • It seems I did not see that when migrating to the production database one function, which retrieves localized string in MySQL lost its correct charset. Changing back to UTF-8 did the trick and solved the problem.