Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UTF-8 Decode for php

I am fetching posts from the Tumblr API and am running into an encoding issue with the returned "body" of the "post". All apostrophes are replaced by something that looks like "aETM".

I am trying to use:

utf8_decode($string)

But all that does is replace the occurrences of "aETM" with a "?".

Any suggestions?

like image 212
Jon Rubins Avatar asked Aug 01 '12 23:08

Jon Rubins


1 Answers

try

$string = mb_convert_encoding($string,'HTML-ENTITIES','utf-8');
like image 125
voodoo417 Avatar answered Oct 21 '22 03:10

voodoo417