0
I have a file js
, in which I minify to perform the proper tasks. What happens whenever I add this js
on my pages, where it is called, the characters of the Portuguese language become illegible. So I think either the missing or the UTF-8
or the ISO-8859-1
. But the question is, how do I put these calls in a single place in my file js
, so that any function within the file makes use of these includes. A single read. I would not like that in each method I put this call, unless there is no way. Example below, I put only a part of my file js
, the start and part of one of the existing functions:
var tituloMultiBrowser;
(function () {
window.showModalDialog = window.showModalDialog || function (url, arg, opt) {
url = url || ''; //URL
arg = arg || null; //Argumentos
opt = opt || 'dialogWidth:300px;dialogHeight:200px'; //Opções: dialogTop;dialogLeft;dialogWidth;dialogHeight/CSS styles
//Função Chamadora
var caller = showModalDialog.caller.toString();
var doc;
var i = 0;
if (window.parent.name == 'JANELASIS') {
doc = window.parent.document;
}
else {
var janela = window.parent.name;
var janelaPai = window.parent;
while (janela != 'JANELASIS' && i <= 20) {
janelaPai = janelaPai.parent;
janela = janelaPai.parent.name;
i++;
}
doc = janelaPai.parent.document;
}
..............................
}
Why don’t you standardize everything for UTF-8?
– Alexandre Borela
The issue is not in being utf or iso, but where. I already did, but as what I did is the same thing posted by Gabriel Rodrigues, I decided to mark his answer, because he gave me the same solution that I had found. Thank you.
– pnet
That’s why I talked about standardizing everything for UTF-8, adding BOM to the files it solves. HTML5 even added a rule where BOM overrides any character statement in the body of the document. http://www.w3.org/International/questions/qa-byte-order-mark.en.php
– Alexandre Borela
Just out of curiosity, the UTF-8 zoomed in here. I only got it with ISO-8859-1. I don’t know, technically, what each of them does differently from the other, but one went right and the other didn’t.
– pnet
ISO 8859 1 is extended ASCII where normal ASCII uses only 7 bits, the extended adds 1 more. There are several of them, UTF8 which is one of the Unicode representations (there are others, UTF16, UTF32...) supports all existing languages on the planet and even some false (Klingon). The theme is a bit confusing at first, this article http://www.joelonsoftware.com/articles/Unicode.html helps to understand the differences.
– Alexandre Borela