Created
January 26, 2015 18:40
-
-
Save chichunchen/8f39ac17684781022391 to your computer and use it in GitHub Desktop.
用 wget 从服务器下载文件经常遇到中文文件名变成乱码的问题。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
reference: http://m13253.blogspot.tw/2013/04/solve-corrupted-chinese-filename-for-wget.html | |
其实不必要像那样修改源代码,wget 的 man 页面里就有解决方法。 | |
正解是参数 --restrict-file-names=nocontrol | |
Update: +筱百合 提供了他的 ~/.wgetrc 文件,方便大家借鉴: | |
# 不要乱转义中文 | |
--restrict-file-names=nocontrol | |
# 使用重定向后的文件名 | |
--trust-server-names=on | |
--content-disposition=on | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
我这边win10 cmd 窗口直接提示404 无法找到,试过了各种方式无效
wget -c -r -np -k -L -p -x -nc -N --restrict-file-names=nocontrol http://xxxxxx