]> sjero.net Git - wget/blobdiff - src/main.c
Automated merge.
[wget] / src / main.c
index 8002c1be2a0303e08702fab8f4556665f4de5169..53ea6b9109baf6245ffd22a272d1abef021caf04 100644 (file)
@@ -57,6 +57,7 @@ as that of the covered work.  */
 #include "convert.h"
 #include "spider.h"
 #include "http.h"               /* for save_cookies */
+#include "iri.h"
 
 #include <getopt.h>
 #include <getpass.h>
@@ -1066,18 +1067,16 @@ for details.\n\n"));
 #ifdef ENABLE_IRI
   if (opt.enable_iri)
     {
+      if (opt.locale && !check_encoding_name(opt.locale))
+        opt.locale = NULL;
+
       if (!opt.locale)
-        {
-          opt.locale = getenv ("CHARSET");
+        opt.locale = find_locale ();
 
-          if (opt.locale == NULL)
-            opt.locale = nl_langinfo(CODESET);
-        }
-      else
-        {
-          /* sXXXav : check given locale */
-          logprintf (LOG_VERBOSE, "Check the locale...\n");
-        }
+      if (opt.encoding_remote && !check_encoding_name(opt.encoding_remote))
+        opt.encoding_remote = NULL;
+
+      logprintf (LOG_VERBOSE, "Locale = %s\n", quote (opt.locale));
     }
 #else
   if (opt.enable_iri || opt.locale || opt.encoding_remote)