I'm using the following AJAX call to fetch a text file containing Japanese characters from another directory in the same Github repo.
$.ajax({
type: "GET",
url: "https://raw.githubusercontent.com/mystuff/japaneseProject/master/data/jp.txt",
contentType: 'text/plain; charset=utf-8',
dataType: "text",
cache: false,
success: function(data) {
console.log(data);
}
});
The output of console.log(data)
, however, is just garbage:
Something is going on with the encoding, probably, but I have no idea what. Initially the URL was a direct Dropbox link which worked perfectly, but since Dropbox discontinued its public folder, it no longer does.
If I try other hosting services like Google Drive, I either hit a CORS error or the same garbage is outputted.