I tried many suggestions to read in a textfile with German special characters (ä,ö,ü). In the end:
$.ajax({
async:false,
type: "GET",
url: "data/FileName.txt",
dataType: "text",
contentType: "application/x-www-form-urlencoded;charset=UTF-8",
success: function (data) {
alert(data);
}
});
let me read in the special characters, but only AFTER I explicitly saved FileName.txt in the UTF-8 format. The standard format for saving text files in the Windows Editor is ANSI and not UTF-8, but it can be changed if you "Save as" and use the dropbox next to the Save-Button or use a better Editor to start with.