`

curl保存文件及中文乱码解决

阅读更多

curl 后结果保存文件,直接重定向即可:

curl 'http://ab.com' > a.txt

 

如果curl结果包含中文,a.txt可能乱码,需要使用 iconv转换,iconv是mac自带的工具,使用命令:

curl 'http://ab.com' | iconv -f gbk -t utf8 > a.txt 

 

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics