Perfidus Posted November 4, 2009 Share Posted November 4, 2009 Hi there! I'm using the load() function from jquery which uses ajax to load php inside a div in a document. This document has a tag for utf-8 encoding in it's correct place, so I thought that all the contents loaded inside the document will follow the rule: I WAS WRONG. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> I have seen my problem in lot's of forums but the answers given over them don't work for me. My php looks more or less like this: <?Php header ('Content-type: text/html; charset=utf-8'); if($condition = true) { ?> HERE GOES SOME HTML AND THIS IS WHAT I'M LOADING <? } ?> As you can see, I'm also adding a header to tell the PHP that it must be utf-8 encoded, but maybe because the content is outside the <? ?> tags, it is not afecting it, so I get weird characters in the document. How can I fix that? Link to comment https://forums.phpfreaks.com/topic/180291-problem-with-encoding-php-and-jquery/ Share on other sites More sharing options...
YourNameHere Posted November 4, 2009 Share Posted November 4, 2009 is the page you're loading it to (the one with the ajax call) encoded UTF-8? Link to comment https://forums.phpfreaks.com/topic/180291-problem-with-encoding-php-and-jquery/#findComment-951060 Share on other sites More sharing options...
Perfidus Posted November 4, 2009 Author Share Posted November 4, 2009 Yes, it is. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> Link to comment https://forums.phpfreaks.com/topic/180291-problem-with-encoding-php-and-jquery/#findComment-951064 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.