[jQuery] xml post with special characters
Hi,
Im developing an application with jQuery ajax-plugin and Struts.
Seems that the current xml function dosent handle special characters?
(in this case swedish characters)
Any one else had this kinds of problems?
This application is only run on IE 5.x and above, my guess is that FF
handles every aspect of encoding better then IE.
Well this is what i had to do to get struts to decode the values correctly.
$.xml = function( type, url, data, ret ) {
var xml = new XMLHttpRequest();
if ( xml ) {
xml.open(type || "GET", url, true);
if ( data )
// xml.setRequestHeader('Content-Type',
'application/x-www-form-urlencoded);
xml.setRequestHeader('Content-Type',
'application/x-www-form-urlencoded; charset=UTF-8');
if ( ret )
xml.onreadystatechange = function() {
if ( xml.readyState == 4 ) ret(xml);
};
xml.send(data)
}
};
Best regards
Christian Bach
_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/