I have a problem with the characters. I basically open txt files (with an accent) through ajax, but I'm having trouble with the accents. I want to know if there is an ajax way to open the txt file with accents.
<script charset="UTF-8" >
function corpo(titulo, texto) {
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
document.getElementById("titulo").innerHTML = titulo;
document.getElementById("corpo").innerHTML = this.responseText;
}
};
xhttp.open("GET", 'arquivos/'+texto, true);
xhttp.send();
}
</script>