]> sjero.net Git - wget/blobdiff - src/main.c
Introduce a new function check_encoding_name() for doing a basic check on encoding...
[wget] / src / main.c
index fc41153b2a862e774f37250e32721aff7dae538b..53ea6b9109baf6245ffd22a272d1abef021caf04 100644 (file)
@@ -1067,10 +1067,14 @@ 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 = find_locale ();
 
-      /* sXXXav : check given locale and remote encoding */
+      if (opt.encoding_remote && !check_encoding_name(opt.encoding_remote))
+        opt.encoding_remote = NULL;
 
       logprintf (LOG_VERBOSE, "Locale = %s\n", quote (opt.locale));
     }