I have 2 cases here:
My Database contains lots of info which I want to fetch to the page, some of these info are name which contain non-ascii chars like Uwe Rü
Thanks to Aaron Digulla's answer, I followed the string from server to the page and found that it is gets misrepresented after the AJAX LOAD
, so I found this answer which resolved my problem. Although I had to use the charset="iso-8859-1"
for it to work rather than charset="UTF-8"
.
So the final answer is:
-Encoding in the HTML page:
-Encoding the Ajax data:
$.ajaxSetup({
'beforeSend' : function(xhr) {
xhr.overrideMimeType('text/html; charset=iso-8859-1');
},
});
And now chars are displayed correctly. Thanx for your help guys..