How can i set XMLHttpRequest to support Unicode when it pass data by QueryString?
I use regular XmlHttlRequest, everything work fine except the unicode. How can i set that the query string will support unicode, (right now it return to c# '??????' when i pass unicode character (Hebrew)). I've tried to set the globalization setting to UTF-16 or Unicode in the web.config like this:
But it still pass '????'.
I attach pic of my code although its a XmlHttpRequest regular code like开发者_JAVA技巧 everyone know.
Thank you!
XMLHttpRequest won't modify URLs (other than removing invalid characters), you have to build the correct URL yourself. That's what encodeURIComponent
function is good for:
xmlRequest.open("GET", "foo.apx?name=" + encodeURIComponent(name));
精彩评论