1

I am getting filename from file obj in javascript and sending the same to server using AJAX.

var uploadFile = document.getElementById("uploadFile");
var filename = uploadFile.files[0].name;

The problem is non English characters found in filename such as 'çõ' and the chars converted to "�". I also set "Content-Type=text/html; charset=UTF-8" in the page.

How can I solve this problem?

Note: This problem occurs only in windows laptops

4

1 回答 1

0

I solved the problem:

filename = unescape(encodeURIComponent(filename));
于 2013-10-11T17:41:06.317 回答