linuxwgetfedorasmart-quotes

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


I'm learning wget utility in fedora 23. In many use of wget I receive same errors. for example one of commands that I tested is :

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

but I get this :

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/

Solution

  • In your wget ‐‐output-file=logfile.txt, the two characters before output-file are not an (ASCII) HYPHEN-MINUS (-, U+002D) but a HYPHEN (, U+2010). That's why wget's option parser doesn't recognize it as an option but instead tries to resolve it as a hostname.

    --recursive and --spider have the same problem.

    Delete those hyphens and retype them with your - (minus) key. That should fix it.