1
I’m having a problem that seems simple but has given me work here.
I’m developing a single page application using Angularjs, on the page index.html
i have the tag <meta charset="UTF-8"/>
, and like all the partials are injected into this page, the encoding is replicated to them except for 1 file, outside that I am not being able to replicate the encoding for the Javascript, Alerts and registered messages on console.log
are not receiving the encoding.
Does anyone know what could be going on ?
Follows html code:
<html ng-app="WebApp">
<head>
<meta charset="UTF-8" />
<title></title>
<link href="css/style.css" rel="stylesheet" type="text/css" />
"... demais arquivos css"
</head>
<body ng-controller="mainController">
<!-- Bibliotecas externas-->
<!-- Config -->
<!-- Services -->
<!-- Controllers -->
<!-- template do header -->
<div ng-include="'partials/header.html'"></div>
<!-- Templates do Angular controlados pelas rotas-->
<div ng-view></div>
<!-- template do footer -->
<div ng-include="'partials/footer.html'"></div>
</body>
</html>
Good morning, all files are saved as UTF8 without GOOD?
– Guilherme Nascimento
Yes, I’m saving with utf-8 encoding in sublime text
– Caio Torres
All files, both . js and . html? Could you provide a simple example of the problem to test?
– Guilherme Nascimento
I created a Pastebin to make it easier: http://pastebin.com/7704vqHu As you will see, the content is dynamically injected into the ng-view directive, so the partials when they are rendered by the browser will "inherit" this index.html. I have a partial that is nothing more than an ordered list of Buttons that when injected into ng-view gives encoding error of the seated characters, whereas another that is practically identical, the same problem does not happen.
– Caio Torres
But it only has html, we need js too.
– Guilherme Nascimento
Already tried with: <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> ?
– Breno Henrique
Thank you so much for the personal answers, I think the problem had something to do with some sublime configuration error at the time the files were saved, I went back to the initial settings and saved in UTF-8 with BOM and it all worked out.
– Caio Torres