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编码。