I hava 2 php files. index.php and preview.php
in the top of index.php I have this code
<meta http-equiv='Content-Type' content='Type=text/html; charset=utf-8'>
When I try to load content to index.php from preview.php using:
function preview_content(id)
{
var thebutton = '#previewButton';
$(thebutton).hide();
$('#preview_area').load('preview.php?id='+id);
}
the content loaded with characters like this M�laga CF
I tried to put the same utf-8 code in the top of preview.php but nothing changed. Is there any way to retrieve the content with UTF-8 charset?
Please be sure about
preview.php‘s encoding isUTF-8. Your editor’s default encoding applies newly created files but if you copiedpreview.phpfrom somewhere else it’s encoding might be different. Also addingheader('charset=utf-8');as first line topreview.phpmight help. Like this;You can also use
.ajax()and specifycontentTypeinstead of.load();