Accentuation is unreadable on the page

Asked

Viewed 7,995 times

4

My page (Header of a table and a modal popup), in accented letters or characters of the Portuguese language, are coming illegible. At the head of the page I have that statement:

<head>
<title><%=Application("app")%></title>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />

<script type="text/javascript" src="../../gen/modal/jquery-ui.min.js"></script>
<script type="text/javascript" src="../../gen/modal/modal.crossbrowser.min.js"></script>

<link rel="stylesheet" type="text/css" href="\gen\css\css002.css">

<link rel="stylesheet" type="text/css" href="\gen\css\css007.css"> <!--cadeia de pagamento -->
<script type="text/javascript" src="\gen\js\tabelafixa.js"></script><!--cadeia de pagamento -->

<script src="../../gen/js/cpaint2.inc.compressed.js" type="text/javascript"></script>

<script type="text/javascript" src="\atb\asp\atb0037.js?<%=now()%>"></script>
<script type="text/javascript" src="\atc\asp\atc0006.js?<%=now()%>"></script>
<script type="text/javascript" src="\cal\asp\cal0087.js?<%=now()%>"></script>
<script type="text/javascript" src="\cal\asp\cal0088.js?<%=now()%>"></script>
<!--INICIO BARRA DE PROGRESSO-->
<script type="text/javascript" src="../../gen/js/waitbar.js"></script>
<link rel="stylesheet" type="text/css" href="\gen\css\progbar.css">
<!--FIM BARRA DE PROGRESSO-->
</head>

In the meta tag I also did it and did not solve:

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

I already passed UTF to UTF and still nothing. I have a popup calling page and in it I have the includes and meta for characters. The grid(table) is on the same page that calls the popup. see the grid image as it is. inserir a descrição da imagem aqui

  • If you change the charset for utf-8, works?

  • I had the same problem, try this: In the call of the script file include the charset="ISO-8859-1" <script type=... charset="ISO-8859-1">

4 answers

4


According to that answer the charset sent by the HTTP header Content-type takes precedence to charset informed by metatag, possibly why change the meta tag did not resolve, check the response headers if there is information charset.


Complementing with an example the error of charset (source):

"Song" stored in UTF-8 and aired as ISO-8859-1: Cana§

"Song" stored in ISO-8859-1 and displayed as UTF-8:

  • Dude, I had something similar to what you’re posting. I’ll give you a more detailed check and whether or not to resolve, post.

  • @pnet It may also be that the file with this HTML table is in UTF-8, as its code looks like ASP, I imagine you are using IIS, and the project is in ISO-8859-1, if that is the case, modify the charset file with Notepad++ (or other editor) must resolve

  • Man, good morning. As I said, I’ve used both and nothing. What I suspect is the js file(We have a file to run the papups in a Modal way). I think it might be him, because every time we put him on the page, this problem happens. I’m opening it right now to see if I see anything interesting that might alter the page.

3

I did a test using the goal you passed and the body only with "Test". With UTF-8 it worked and with ISO-8859-1 it failed. Put in a test.html file just the following:

<html>
<header>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
</header>
<body>
      Teste çãáâõ
<script src="teste.js"></script>
</body>
</html>

and you’ll see that it works. At least it worked for me in Firefox. So it’s definitely something other than the meta tag. Look to remove all lines of scripts, test and go putting one by one. I think it’s quite possible that @Sanction’s response is also relevant.

1

Searching the internet I managed to find a code table that replace the accents, follows below:

á = \u00e1 à = \u00e0 â = \u00e2 ã = \u00e3 ä = \u00e4 Á = \u00c1 À = \u00c0 Â = \u00c2 Ã = \u00c3 Ä = \u00c4 é = \u00e9 è = \u00e8 ê = \u00ea ê = \u00ea É = \u00c9 È = \u00c8 Ê = \u00ca Ë = \u00cb í = \u00ed ì = \u00ec î = \u00ee ï = \u00ef Í = \u00cd Ì = \u00cc Î = \u00ce Ï = \u00cf ó = \u00f3 ò = \u00f2 ô = \u00f4 õ = \u00f5 ö = \u00f6 Ó = \u00d3 Ò = \u00d2 Ô = \u00d4 Õ = \u00d5 Ö = \u00d6 ú = \u00fa ù = \u00f9 û = \u00fb ü = \u00fc Ú = \u00da Ù = \u00d9 Û = \u00db ç = \u00e7 Ç = \u00c7 ñ = \u00f1 Ñ = \u00d1 & = \u0026 ' = \u0027

Example:

alert("O campo nome é de preechimento obrigatório ");

Replacing would be:

alert("O campo nome \u00e9 de preenchimento obrigat\u00f3rio");

1

just put the meta tag with the charset type utf-8

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

If you do not solve then you will have to configure in the http server configuration file ( apache, toncat etc. ) if you need help for these cases just comment below that edits the response

  • Here we used the IIS, but see the following. It did not give "stick" before. After I included a jquery-ui.min.js call and a js file of ours to display modal pages, I noticed this problem. Type, before changing a form worked, when including these calls, I made the changes, and the changes is just renaming a function of: Abrepesquisa for Abrepesquisamultibrowser and this function is in our file js, newly created. I think something is conflicting in that file. It used to be UTF-8.

Browser other questions tagged

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