Problems with accentuation

0

I have visited several sites and StackOverflow was the main one, where several solutions were proposed for page accentuation problems. I noticed that I had set up my wrong database (utf8-bin) and my page was with ISO-8859-1 charset. I have corrected and already tried everything but my header continues displaying strange characters like the one below:

Myheaderlookslikethis:

<?php$title=BD::conn()->prepare("SELECT 'title', 'id', 'keywords', 'description' FROM 'pags' WHERE 'id' = ? LIMIT 0 , 1");
        $title->execute(array($pag));
        $dados = $title->fetch();
?>

<!doctype html>
<html lang="pt-br">
<head>
<meta charset="utf-8">
<title><?php echo $dados['title']; ?> - Gopinatha &reg;</title>
<meta http-equiv="content-type" content="text/html;charset=utf-8" />

My bank looks like this:

Mytablelookslikethis:

Andthefieldinquestionlookslikethis:

    
asked by anonymous 12.10.2017 / 19:42

2 answers

0

The problem is that in the database does not allow accent but allows special characters that replace them.

I recommend this site . In the box above, type the text of the database, then convert and paste it into the database and it will be fine.

    
12.10.2017 / 20:58
1

Try to put a header before your html, like this:

<?php
       header("Content-type: text/html; charset=utf-8");
       setlocale(LC_TIME, 'pt_BR', 'pt_BR.utf-8', 'pt_BR.utf-8', 'portuguese');
       date_default_timezone_set('America/Sao_Paulo');
?>

    <!doctype html>
    <html lang="pt-br">
    <head>
    <meta charset="utf-8">
    <title><?php echo $dados['title']; ?> - Gopinatha &reg;</title>
    <meta http-equiv="content-type" content="text/html;charset=utf-8" />
    
12.10.2017 / 19:45