I am having an issue here with a form being posted via Ajax.
Here is my jQuery code:
<script type="text/javascript" language="javascript" charset="utf-8">
$(document).ready(function(){
$("#newdata").submit(function(event) {
event.preventDefault();
$.post( "save.asp", $("#newdata").serialize() ,
function( data ) {
});
});
});
</script>
The problem is when I submit data with special characters like ® or © it saves it with an  in front of it. But if i submit without the jQuery/Ajax it doesn’t format the data with this  character. Does anyone know why I’m having this problem?
http://jsfiddle.net/aTS67/2/
The problem is with the
.serialize()method (it is not really a problem, it should do this). As you can see from my demo above when you use the method it encodes the special characters (as it should). You have two options:Decode the url-encoded string on the server-side. You didn’t mention what technology you are using but their is likely a function that will do this for you. For PHP for instance you may use
htmlspecialchars_decode("YOUR ENCODED STRING");but there will be something similiar for all server-side languages (best option)Instead of using
.serialize()you can build the string sent to the server-side manually. You can replace$("#newdata").serialize()with an object literal of key value pairs:{"InputId1" : $("#InputId1").val(), "InputId2" : $("#InputId2").val()}Edit
Just saw the extension on your file is ASP so you are using classic asp. I am not sure what the syntax is to decode but I am sure it is easy to find.