HTML Character Encoding to accept UTF

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 aprovados em menos de dois minutos!"

When I output to the user, this is whats showing:

Incorrect Version:

"Três 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>

Try this mysqli_set_charset($link, "utf8"); and put this on the header <meta charset="UTF-8">


I was having the same problem with spanish characters not showing properly using hostgator hosting and I solved by changing the character set to UTF-8 of the document itself on the text editor, PSPad on my case. Check the image:

在这里输入图像描述

链接地址: http://www.djcxy.com/p/33066.html

上一篇: Connector.php第55行中的Laravel PDOException错误

下一篇: HTML字符编码接受UTF