I'm working on a website for a client who's located in Brazil. A section of his website shows feedback/reviews from users.
Here is an example:
Correct Version:
"Três vistos aprovados em menos de dois minutos"
When I output to the user, this is whats showing:
Incorrect Version:
"Três vistos aprovados em menos de dois minutos"
I'm saving these reviews to a mySQL database (Hostgator) and I've set my database collation to "utf8_unicode_ci".
At the top of my HTML decument, I've declared this:
<!DOCTYPE html>
<html lang="pt-BR" class="fixed">
<head>
<title>@yield("title")</title>
<!-- Basic -->
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body>
<!-- Rest of the page is here -->
</body>
</html>
I'm using Laravel 5 to grab my data from the DB and I display it like so:
{{ mb_convert_encoding($feedback->message, "UTF-8") }}
Funny thing is, if I use the code above on my localhost, the correct "review" is shown. But once I upload it to hostgator, the "review" is not shown correctly.
If I change it to "{{ mb_convert_encoding($feedback->message, "auto") }}", the correct "review" is shown on uploaded page but on my localhost, the wrong "review" is shown.
I've never ran into this issue before! When I get phpinfo on the clients hostgator page, it shows that "default_charset" is set to "null"
Could that be the issue?
Thanks!
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire