mercredi 18 février 2015

windows.location not working with UTF characters


I used ajax for the search function. However, it failed to search unicode characters. Here is the code causing a problem





success: function(data){
var url = base_url + "/?s=ryhmät";
location.href=url;
}



The url passed correctly, but location.href has the value of encoded characters. like base_url/?sryhm%E4t


I tried to use decodeURI/encodeURI functions, seems not working. I would appreciate if anyone could suggest me a solution.





Aucun commentaire:

Enregistrer un commentaire