Malformed UTF-8 characters, possibly incorrectly encoded 或中文乱码 (Uncaught InvalidArgumentException: Malformed UTF-8 characters, possibly incorrectly encoded in)

问题: Uncaught InvalidArgumentException: Malformed UTF-8 characters, possibly incorrectly encoded in

 

是返回的数据有特殊字符,编码转换回来就好了

mb_convert_encoding($value, 'UTF-8', 'UTF-8');

 

中文乱码可以用以下方法转码

$content = mb_convert_encoding( $result, 'UTF-8', 'UTF-8,GBK,GB2312,BIG5' );

意思就是把UTF-8,GBK,GB2312,BIG5这几种编码转成UTF-8编码。

 

 

posted @ 2019-11-22 01:36  搬砖小伙子  阅读(17732)  评论(0编辑  收藏  举报