首页 > php的iconv编码转换问题!

php的iconv编码转换问题!

    public function file_get(){
        $file = file_get_contents('Curl.html');
        iconv("ANSI", "UTF-8//IGNORE", $file);
        return empty($file) ? null : $file;
    }
}
header("Content-type: text/html; charset=utf-8");

$url = new mycurl();

$file = $url->file_get();

echo strip_tags($file);

Curl.html如下:

输出如下:(乱码!)

Notice: iconv(): Wrong charset, conversion from `ANSI' to `UTF-8//IGNORE' is not allowed in D:\xampp\htdocs\function\function\cURL\curl5.php on line 34
HTTP/1.1 200 OK Date: Mon, 03 Feb 2014 12:00:13 GMT Server: ATS/3.2.4 X-Powered-By: PHP/5.3.9 Vary: Accept-Encoding Content-Type: text/html Age: 0 Transfer-Encoding: chunked Proxy-Connection: keep-alive Via: http/1.1 nxats01.ehomenet.com (ApacheTrafficServer/3.2.4 [cMsSf ]) ��ע�����й������� a {color:#333;text-decoration:none;} a:hover, a:active, a:focus{color:#f00;text-decoration:underline;} img{border:0} body{margin:0px;font:12px "����";background:url(http://static.sporttery.cn/info/roll/images/TopBg-ZQ.png) no-repeat;background-position:top center} .footer{width:1000px;line-height:22px;text-align:center;font-size:12px;color:#000000;margin-top:15px;} .wrap{width:1000px;margin:auto;} .Main{width:998px;border-left:1px #EEEEEE solid;border-right:1px #EEEEEE solid;background:url(http://static.sporttery.cn/info/roll/images/MainBg.gif) repeat-x;background-position:top;float:left} .MainLeftBox{width:686px;margin-left:11px;display:inline;float:left} .MainRightBox{float:right;width:269px;margin:-30px 7px 0 0;} .Two_dot{width:686px;height:1px;background:#EBEBEB} .YourPosition{color:#333333;margin:6px 0 0 8px;height:24px} .YourPosition a{color:#333333;} .YourPosition a:hover{color:#FF0000;} .dot{background:url(http://static.sporttery.cn/info/roll/images/2_dot2.gif) repeat-x;width:686px;} /*Banner1*/ .Banner{position:absolute;margin:1394px 0 0 6px;border:1px #000000 solid} /*Banner2*/ .banner2{width:984px;height:88px;position:absolute;margin:2320px 0 0 6px;border:1px #006086 solid} *{font-size:12px;line-height:1.5em;} .wrap{width:100%} .banner,.footer,#main_nav,.crumb form,.titleSc,.hideforprint{display:none;} .crumb *{display:none;} .crumb{text-align:left;font-weight:bold;line-height:26px; } table{width:100%; } table{border-collapse:collapse;} table th,table td{border:1px solid #333;font-size:12px;;line-height:1.2em;padding:2px;width:auto; } ����ʱ�䣺01-29 15:43 [ˢ��]   �й������� >> ��ע���� ��������     |    ȫ������ �����׼������¹��׼����������׼��������ϻᱭ��������߱����籭Ԥѡ���ո������������������������������������׼�����Ӣ������������Ӣ�����ھ�����Ӣ�����׼����� ע ����ҳ����ʾ����δ����������Ϣ���鿴���������������ع̶�����ʤƽ���淨ҳ�桱��   �������� ȫ������Ͷ ���±�� ���� ���� VS �Ͷ� Ԥ�ƽ�ֹ����ʱ�� ������Ѷ ����״̬ ��ע �ر���ʾ �������� ����002�¹��׼�����˹ͼ���� VS ����Ľ���2014-01-30 02:59 �ѿ�������003�������������϶��Ͷ����� VS �����ᄎ��2014-01-30 02:59 �ѿ�������008Ӣ������������������ķ�ȴ� VS ����˹�س�2014-01-30 03:44 �ѿ�������009��������Dz���˹ VS �����2014-01-30 03:44 �ѿ����ܶ����� �ܶ�018Ӣ�����׼������ƶ���˹���� VS ʲ³˹����2014-01-29 03:44 �ѿ����������� ����001�����׼��������� VS ����л��2014-01-30 01:59 �ѿ�������004Ӣ�����׼�����л�ƶ����� VS �˵ñ���2014-01-30 03:29 �ѿ�������005Ӣ������������ɣ���� VS ˹�п˳�2014-01-30 03:44 �ѿ�������006Ӣ��������������˹��ά�� VS ������ķά��2014-01-30 03:44 �ѿ�������007Ӣ�������������ж��� VS ����ķ��2014-01-30 03:44 �ѿ�������010�ո������������������� VS ������ŵ��2014-01-30 03:44 �ѿ���δ����: ʤƽ������,ʤƽ����������011�ո��������������� VS ʥ����2014-01-30 03:44 �ѿ�������012�������������������� VS ������2014-01-30 04:59 �ѿ���δ����: ʤƽ������,ʤƽ����������013��������߱����� VS ��������2014-01-30 07:59 �ѿ�������014��������߱�ˮ������ VS �����ɾ���2014-01-30 07:59 �ѿ����������� ����001Ӣ�����ھ�����ŵ����ɭ�� VS ���ظ���2014-01-31 03:44 �ѿ�������002������������ɣ̹�¾��� VS �ʼ����2014-01-31 03:59 �ѿ�������003��������߱�������ѧ VS ����ɭ������2014-01-31 06:59 �ѿ�������004��������߱�������˹ VS ��Ŭ˹2014-01-31 09:14 �ѿ��� ע ����ҳ����ʾ����δ����������Ϣ���鿴���������������ع̶�����ʤƽ���淨ҳ�桱�� match_counts('19'); 

$file = iconv("gbk", "UTF-8//IGNORE", $file);
这样就OK了。

【热门文章】
【热门文章】