I have just started working with Laravel, having worked with PHP & MySQL for a few years now, and have just come across a problem i can't seem to solve.

I have a new shop which i have just built in Laravel, sitting on my development server, connected to my development database.

Also I have a CMS system, built in my own framework, on my public server, connected to the public database.

And now i have just uploaded my Laravel shop front end to my public server, connected to the public database.

Both the developmebnt front end (Laravel) and public CMS (my framework) work fine, but the public front end (laravel) won't display special characters:

5” x 7” magnetic frame

Displays as:

5†x 7†magnetic frame

But I'm at a loss, there are no differences between the development and public system, except the environment variables holding the database name, host, username and pass. The public CMS system displays the same characters fine too, so therefore the database must be ok too. (I just straight copied the databse from development to live too.)

Here is the connection array:

'connections' => array(

    'Default' => array(
        'driver'    => 'mysql',
        'host'      => $_ENV['CONN']['DB HOST'],
        'database'  => $_ENV['CONN']['DB DBSE'],
        'username'  => $_ENV['CONN']['DB USER'],
        'password'  => $_ENV['CONN']['DB PASS'],
        'charset'   => 'utf8',
        'collation' => 'utf8_unicode_ci',
        'prefix'    => '',
    ),

),

Any ideas or suggestions would be most welcome!

有帮助吗?

解决方案

Add this to your HTML

<head>
    <meta charset="utf-8">
</head>

It may be defaulting to utf-8 on your local environment if it's not specified and for some reason or another, not in the production environment.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top