diff --git a/src/retr.c b/src/retr.c index a6a9bd7a..ddd46cb6 100644 --- a/src/retr.c +++ b/src/retr.c @@ -872,9 +872,11 @@ retrieve_url (struct url * orig_parsed, const char *origurl, char **file, xfree (mynewloc); mynewloc = construced_newloc; - /* Reset UTF-8 encoding state, keep the URI encoding and reset + /* Reset UTF-8 encoding state, set the URI encoding and reset the content encoding. */ iri->utf8_encode = opt.enable_iri; + if (opt.encoding_remote) + set_uri_encoding (iri, opt.encoding_remote, true); set_content_encoding (iri, NULL); xfree (iri->orig_url);