So I am trying to check if a pdf file exists on my server or not.
PDF files are named in korean like abc.com/토보토보.pdf
I have tried :
function UrlExists(url)
{
var http = new XMLHttpRequest();
http.open('HEAD', url, false);
http.send();
console.log(http.status);
}
But the problem is it always encoded to example.com/%C3%AD%C2%86%C2%A0%C3%AB%C2%B3%C2%B4%C3%AD%C2%86%C2%A0%C3%AB%C2%B3%C2%B4.pdf
UrlExists("example.com/토보토보.pdf")
01:51:29.144 VM428:14
HEAD
http://example.com/%ED%86%A0%EB%B3%B4%ED%86%A0%EB%B3%B4.pdf
404 (Not Found)
How do i get the solution to my problem?