php does not display accent with utf-8

Asked

Viewed 18 times

2

I am working with PHP 5.6 and SQL Server. I am working with bootstrap and the database is Latin1_general_ci_as. My HTML is as below:

<!DOCTYPE html>
<html lang="pt-br">
  <head>
    <meta charset="utf-8">
    <meta name="description" content="Free Web tutorials">
    <meta name="keywords" content="HTML,CSS,XML,JavaScript">
    <meta name="author" content="Hege Refsnes">

    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>

</body>
</html>

Attached printinserir a descrição da imagem aqui

  • 1

    Latin1_general_ci_as is not encoding, it is collation. Collation doesn’t interfere with the output, but probably if the collation is this, the table is in Latin1 and how you’re putting UTF8 on the page, then it won’t even work. Or hit the encoding, or the page. See in the answers of the link indicated above the possibilities to leave your system in order. As a last resort, if you can’t fix the DB or page setting, use the function utf8_encode() to convert the output data.

  • Solved. <?= utf8_encode( $os['Sector name']); ? > .

  • 1

    As I have already marked as duplicate, it is solved, because whoever locates by your question will find the other, that already explains well. The important thing is you have solved it. If I answered here, it would be divided, disturbing the next visitors. Duplicates serve as a way to search for different words, and arrive at the same results.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.