Language (char set?) issue

St_Aug_Beach_Bum used Ask the Experts™
I'm doing this:

$wiki_url = '';
$content_raw = file_get_contents($wiki_url);

and then I strip down to the content I need, which includes removing the meta/header/html.

After doing that, some of the text is in strange characters, like " coup d'état ' instead of " coup d'état ".

What am I dealing with here, and how can I convert the string so it's in english characters, ie: " coup d'etat "

Thanks,  Chris
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®

Use a function called
Top Expert 2008
Wikipedia use utf8, your page is probably using iso-8859-1. I think you need the opposite function from what mallcore suggests: utf8_decode($string).


Yes!  Tried them both, this worked, thank you both for your suggestions.
Learn SQL Server Core 2016

This course will introduce you to SQL Server Core 2016, as well as teach you about SSMS, data tools, installation, server configuration, using Management Studio, and writing and executing queries.

Darn. Missed the follow-up opportunity. :) Oh well. cxr basically said what I was trying to explain in the last question you asked.


Heh, well, if you do javascript as well, I've got another challenge at:

Another one of my 'almost there, but not quite working right' projects I'm trying to work on today :)

I don't see js on your profile though...

Hmm,  guess I forgot about JS when I was tweaking my profile the other day. I can do JS. :) Hope I answered your JS question.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial