UTF-8 Does not work on all pages

Asked

Viewed 319 times

0

I’m having trouble using the charset='UTF-8'. I am developing a website for a college project using MVC and as a standard I declared the utf-8 in a view to be used as a standard for other views, but in most pages Unicode works, and in others not, and I use the same standard for all views. Does anyone know any way to fix this or why it was wrong?

<!DOCTYPE html>
    <html lang="pt-BR">
    <head>
        <base href="/<?php echo $baseUrl ?>" />
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <title>
            <?=$title?>
        </title>
    </head>

    <body>
        <section>
            <?php $this->controller->renderView();?> 
        </section>
        
    </body>

  • What is your problem?

  • In some views it’s as if I’m not declared utf-8

  • post your view code that doesn’t work please see before if you actually declared the <meta charset='UTF-8 tag' .... >

  • @Good afternoon, I don’t use includes

  • @Victor posted the base code I use on the site

  • See if you can put this in the web.config file: <globalization fileEncoding="utf-8" requestEncoding="utf-8" responseEncoding="utf-8" culture="pt-br" />

Show 1 more comment

1 answer

0

I’m not sure if this is going to work but I believe so, so try this:

<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

Browser other questions tagged

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