X-Git-Url: http://sjero.net/git/?p=wget;a=blobdiff_plain;f=src%2Fmain.c;h=0727b1db5ac3d85bbb095fdca1cf699e45e612f6;hp=28b04b30114f66bd876a5280846956f9583dff46;hb=8fc5241a2d391f2b0b460e6ee2a4cd71aa764d1e;hpb=de86fc8c82b0ccaeb6acde6a27f6e6b7f54a489d diff --git a/src/main.c b/src/main.c index 28b04b30..0727b1db 100644 --- a/src/main.c +++ b/src/main.c @@ -43,6 +43,9 @@ as that of the covered work. */ #include #include #include +#ifdef ENABLE_IRI +#include +#endif #include "utils.h" #include "init.h" @@ -190,10 +193,16 @@ static struct cmdline_option option_data[] = { "inet6-only", '6', OPT_BOOLEAN, "inet6only", -1 }, #endif { "input-file", 'i', OPT_VALUE, "input", -1 }, +#ifdef ENABLE_IRI + { "iri", 0, OPT_BOOLEAN, "iri", -1 }, +#endif { "keep-session-cookies", 0, OPT_BOOLEAN, "keepsessioncookies", -1 }, { "level", 'l', OPT_VALUE, "reclevel", -1 }, { "limit-rate", 0, OPT_VALUE, "limitrate", -1 }, { "load-cookies", 0, OPT_VALUE, "loadcookies", -1 }, +#ifdef ENABLE_IRI + { "locale", 0, OPT_VALUE, "locale", -1 }, +#endif { "max-redirect", 0, OPT_VALUE, "maxredirect", -1 }, { "mirror", 'm', OPT_BOOLEAN, "mirror", -1 }, { "no", 'n', OPT__NO, NULL, required_argument }, @@ -227,6 +236,9 @@ static struct cmdline_option option_data[] = { "referer", 0, OPT_VALUE, "referer", -1 }, { "reject", 'R', OPT_VALUE, "reject", -1 }, { "relative", 'L', OPT_BOOLEAN, "relativeonly", -1 }, +#ifdef ENABLE_IRI + { "remote-encoding", 0, OPT_VALUE, "remoteencoding", -1}, +#endif { "remove-listing", 0, OPT_BOOLEAN, "removelisting", -1 }, { "restrict-file-names", 0, OPT_BOOLEAN, "restrictfilenames", -1 }, { "retr-symlinks", 0, OPT_BOOLEAN, "retrsymlinks", -1 }, @@ -947,6 +959,24 @@ for details.\n\n")); exit (1); } +#ifdef ENABLE_IRI + if (opt.enable_iri) + { + if (!opt.locale) + { + opt.locale = getenv ("CHARSET"); + + if (opt.locale == NULL) + opt.locale = nl_langinfo(CODESET); + } + else + { + /* sXXXav : check given locale */ + logprintf (LOG_VERBOSE, "Check the locale...\n"); + } + } +#endif + if (opt.ask_passwd) { opt.passwd = prompt_for_password ();