$url ="http://www.amazon.co.jp/dp/B007HDJPOU"; $handle=mb_convert_encoding(file_get_contents($url), 'UTF-8','utf-8, shft-jis, gbk');$sumopen=fopen("001.txt","w");fwrite($sumopen,$handle);fclose($sumopen);本来就是shift-jis编码,没转换
他有
mb_convert_encoding(file_get_contents($url), 'UTF-8','utf-8, shft-jis, gbk');
是不是写错了?
只能把页面编码改成Shift_JIS??
你写的是什么?
'UTF-8','utf-8, shft-jis, gbk'
xuzuning大大,已经改过来了
输出的文件还是乱码
$handle=mb_convert_encoding(file_get_contents($url), 'UTF-8','utf-8, shft_jis, gbk');$sumopen=fopen("001.txt","w");fwrite($sumopen,$handle);fclose($sumopen);$handle=mb_convert_encoding(file_get_contents($url), 'UTF-8','utf-8, shift_jis, gbk');
再想了一下,感觉是编码已经转换了
问题应该出在写入文件上,改成这个试试
$sumopen=fopen("001.txt","w b");
就是按字节输出,你打开这个txt要选无bom utf-8打开
每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号