UTF-8 Decode for php

2019-04-13 22:22发布

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?

2条回答
ら.Afraid
2楼-- · 2019-04-13 23:01

Use this link to convert string

iconv("UTF-8", "CP1252", $data)

查看更多
姐就是有狂的资本
3楼-- · 2019-04-13 23:08

try

$string = mb_convert_encoding($string,'HTML-ENTITIES','utf-8');
查看更多
登录 后发表回答