Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

PHP

PHP UTF 8 Help

Hello guys,

I need some real help with this. I'm working on a client site and he uses a custom CMS which allows him to add information to his site which he does by writing out the content on Microsoft Word then copy and pasting it into the CMS.

Now I'm not sure why it happens but the descriptions in the database show up strange characters like where the accents are supposed to be, sort of like this รขโ‚ฌโ„ข and I've tried setting UTF 8 headers in my code to try and display the information properly but it does not seem to be working.

In my main PHP file I have this code

mb_internal_encoding('UTF-8');
mb_http_output('UTF-8');
header('Content-Type: text/html; charset=utf-8');

And in my header.php file I also have this code

<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">

I'm not sure if the meta http-equiv tag has anything to do with it but I don't think it does.

Any help would be appreciated.

Thanks, Adam