X-Git-Url: http://sjero.net/git/?p=wget;a=blobdiff_plain;f=src%2Fhttp.c;h=741ed2c003fb9a29855725c49fec1b86979c2d48;hp=543165fdd0a7b75f05859b7ad021ccec8b539144;hb=ed558a83f6021fa0f2a138b302ece363c1d0783b;hpb=1a33947ca02dbb568eda1eb0a020abe39e87d86d diff --git a/src/http.c b/src/http.c index 543165fd..741ed2c0 100644 --- a/src/http.c +++ b/src/http.c @@ -49,6 +49,7 @@ as that of the covered work. */ #include "retr.h" #include "connect.h" #include "netrc.h" +#include "iri.h" #ifdef HAVE_SSL # include "ssl.h" #endif @@ -2040,32 +2041,16 @@ File %s already there; not retrieving.\n\n"), quote (hs->local_file)); char *tmp = strchr (type, ';'); if (tmp) { -#ifdef ENABLE_IRI + /* sXXXav: only needed if IRI support is enabled */ char *tmp2 = tmp + 1; -#endif while (tmp > type && c_isspace (tmp[-1])) --tmp; *tmp = '\0'; -#ifdef ENABLE_IRI - if (opt.enable_iri && *tmp2 != '\0' && - (tmp = strstr (tmp2, "charset=")) != NULL) - { - tmp += 8; - tmp2 = tmp; - - while (*tmp2 && !c_isspace (*tmp2)) - tmp2++; - - if (tmp2 > tmp) - { - *tmp2 = '\0'; - /* sXXXav : check given charset */ - logprintf (LOG_VERBOSE, "HTTP charset: `%s'\n", tmp); - } - } -#endif + /* Try to get remote encoding if needed */ + if (opt.enable_iri && !opt.encoding_remote) + /* xxx = */ parse_charset (tmp2); } } hs->newloc = resp_header_strdup (resp, "Location");