I have page that POSTS AJAX to the server, and often the data will be Unicode.
This works most the time, but it appears that sometimes it's breaking and I'm can't seem to find the answer anywhere. I have been using encodeURI, but I'm not sure that's correct.
Here's a example of the code:
$.ajax({
type: "POST",
url: "SomePage.php",
data: "val1=" + encodeURI(unicodeVariable) + "&presentation=" + encodeURI(someUnicodeVariable),
success: function(msg){
}
});
I'm guessing what's happening is sometimes a Unicode character includes an & that's breaking it.
What's the correct way to encode Unicode for an AJAX call with JQuery?
Thanks.