As title indicates. I get a txt file and convert it to web content. The problem is it doesn't display diacritic signs, like o with dash over it or z with dot over. Charset is set to utf-8, language to "pl" and normally there was never any problems.
<head>
<meta charset="UTF-8">
</head>
<body>
<button id="button">Display data</button>
<div id="show">
</div>
<script>
const data = [];
const single = [];
const button = document.querySelector("#button");
const show = document.querySelector("#show");
fetch('data.txt')
.then(response => response.text())
.then(text => data.push(text));
function display() {
const allOfThem = data[0].split("\r");
allOfThem.forEach((person) => {
let newP = document.createElement("p");
newP.innerHTML = "Person's data: " + person;
show.appendChild(newP);
})
}
button.addEventListener("click", display);
</script>
</body>