shell 写道
curl 下载页面时,时常会乱码,可以用:iconv -f gbk -t utf-8 来转码;示例:
[oracle@localhost~]$curlhttp://www.ip138.com/ip2city.asp|grepbody
<bodystyle="margin:0px"><center>?μ?Pμ?·?£o[114.249.221.61]</center></body></html>
[oracle@localhost~]$curlhttp://www.ip138.com/ip2city.asp|grepbody|iconv-fgbk-tutf-8
<bodystyle="margin:0px"><center>您的IP地址是:[114.249.221.61]</center></body></html>