PHP pclzip.php 解压中文乱码

 修改 pclzip中方法privExtractFile 代码

    if ($p_path != '') {
      $p_entry['filename'] = $p_path."/".$p_entry['filename'];
      
      // 获取字符串编码并转为UTF-8
      $encode = mb_detect_encoding($p_entry['filename'], array("ASCII",'UTF-8',"GB2312","GBK",'BIG5'));
      if($encode != "UTF-8"){
        $p_entry['filename'] = mb_convert_encoding($p_entry['filename'], 'UTF-8', 'gb2312');
      }
    }

 

posted @ 2019-08-29 09:53  rubekid  阅读(360)  评论(0编辑  收藏  举报