I recently wrote a crawling script. Most of the content captured is normal, but a small amount of it is garbled
Detect the character encoding and the result is CP936
mb_detect_encoding(<span style="color: #800080;">$str</span>, 'GBK, gb2312, GB18030, ISO-8859-1, ASCII, UTF-8', <span style="color: #0000ff;">true</span>)
Try to convert this encoding, but the result is still garbled
mb_convert_encoding($str, 'UTF-8', 'CP936'); 氓聧掳氓潞娄盲赂聙70氓虏聛猫聙聛氓陇麓莽聦楼盲潞碌7氓虏聛氓楼鲁氓颅漏猫聙聦猫垄芦忙聧聲
Finally found out that this can be transcoded
iconv('utf-8', 'latin1', $str);
iconv('utf-8','latin1//IGNORE', $str);