I forgot to add one other detail that may be useful. If baz.html has a link to another page instead of being empty in an otherwise identical example, Wget will not fetch that page.
Best regards, William Prescott On Fri, Feb 17, 2017 at 6:13 AM, William Prescott <[email protected]> wrote: > Yes, it still does the same even when explicitly setting --local-encoding. > It actually does make it to the linked file eventually, but it saves it to the > wrong folder (this can be seen in the output below). > > ---------------------------------------- > On server: > ~foo/index.html > ~foo/baz.html (empty) > > ~foo/index.html contains > <meta http-equiv="Content-Type" content="text/html;charset=Shift_JIS"> > <a href="baz.html">Baz</a> > > Output: > $ wget -np -r --local-encoding=utf-8 'http://127.0.0.1/~foo/' > --2017-02-17 06:04:02-- http://127.0.0.1/~foo/ > Connecting to 127.0.0.1:80... connected. > HTTP request sent, awaiting response... 200 OK > Length: 98 [text/html] > Saving to: ‘127.0.0.1/~foo/index.html’ > > 127.0.0.1/~foo/index.html > > 2017-02-17 06:04:02 (3.76 MB/s) - ‘127.0.0.1/~foo/index.html’ saved [98/98] > > Loading robots.txt; please ignore errors. > --2017-02-17 06:04:02-- http://127.0.0.1/robots.txt > Reusing existing connection to 127.0.0.1:80. > HTTP request sent, awaiting response... 404 Not Found > 2017-02-17 06:04:02 ERROR 404: Not Found. > > --2017-02-17 06:04:02-- http://127.0.0.1/%E2%80%BEfoo/baz.html > Reusing existing connection to 127.0.0.1:80. > HTTP request sent, awaiting response... 404 Not Found > 2017-02-17 06:04:02 ERROR 404: Not Found. > > --2017-02-17 06:04:02-- http://127.0.0.1/~foo/baz.html > Reusing existing connection to 127.0.0.1:80. > HTTP request sent, awaiting response... 200 OK > Length: 0 [text/html] > Saving to: ‘127.0.0.1/‾foo/baz.html’ > > 127.0.0.1/‾foo/baz.html > > 2017-02-17 06:04:02 (0.00 B/s) - ‘127.0.0.1/‾foo/baz.html’ saved [0/0] > > FINISHED --2017-02-17 06:04:02-- > Total wall clock time: 0.005s > Downloaded: 2 files, 98 in 0s (3.76 MB/s)
