idn_encode 失败 (3): ‘Non-digit/letter/hyphen in input’

idn_encode failed (3): ‘Non-digit/letter/hyphen in input’

我正在学习 fedora 23 中的 wget 实用程序。在多次使用 wget 时,我收到相同的错误。 例如,我测试的命令之一是:

wget ‐‐output-file=logfile.txt ‐‐recursive ‐‐spider http://www.howtogeek.com/

但我明白了:

idn_encode failed (3): ‘Non-digit/letter/hyphen in input’
--2016-06-17 16:40:09--  http://%E2%80%90%E2%80%90output-file=logfile.txt/
Resolving ‐‐output-file=logfile.txt (‐‐output-file=logfile.txt)... failed: No address associated with hostname.
wget: unable to resolve host address ‘‐‐output-file=logfile.txt’
idn_encode failed (3): ‘Non-digit/letter/hyphen in input’
--2016-06-17 16:40:10--  http://%E2%80%90%E2%80%90output-file=logfile.txt/
Resolving ‐‐output-file=logfile.txt (‐‐output-file=logfile.txt)... failed: No address associated with hostname.
wget: unable to resolve host address ‘‐‐output-file=logfile.txt’
--2016-06-17 16:40:11--  http://xn--recursive-u79da/
Resolving ‐‐recursive (xn--recursive-u79da)... failed: No address associated with hostname.
wget: unable to resolve host address ‘xn--recursive-u79da’
--2016-06-17 16:40:17--  http://xn--recursive-u79da/
Resolving ‐‐recursive (xn--recursive-u79da)... failed: No address associated with hostname.
wget: unable to resolve host address ‘xn--recursive-u79da’
--2016-06-17 16:40:18--  http://xn--spider-9f0ca/
Resolving ‐‐spider (xn--spider-9f0ca)... failed: No address associated with hostname.
wget: unable to resolve host address ‘xn--spider-9f0ca’
--2016-06-17 16:40:18--  http://xn--spider-9f0ca/
Resolving ‐‐spider (xn--spider-9f0ca)... failed: No address associated with hostname.
wget: unable to resolve host address ‘xn--spider-9f0ca’
--2016-06-17 16:40:29--  http://www.howtogeek.com/

在您的 wget ‐‐output-file=logfile.txt 中,output-file 之前的两个字符不是 (ASCII) HYPHEN-MINUS (-, U+002D),而是 HYPHEN (, U+2010).这就是为什么 wget 的选项解析器不将其识别为选项而是尝试将其解析为主机名的原因。

--recursive--spider有同样的问题。

删除这些连字符并使用 -(减号)键重新键入它们。这应该可以解决它。