diff --git "a/src\\html-url.orig.c" "b/src\\html-url.c"
index 98502dd..08248d3 100644
--- "a/src\\html-url.orig.c"
+++ "b/src\\html-url.c"
@@ -839,7 +839,7 @@ get_urls_html (const char *file, const char *url, bool *meta_disallow_follow,
   map_html_tags (fm->content, fm->length, collect_tags_mapper, &ctx, flags,
                  NULL, interesting_attributes);
 
-#ifdef ENABLE_IRI
+#ifdef HAVE_ICONV
   /* Meta charset is only valid if there was no HTTP header Content-Type charset. */
   /* This is true for HTTP 1.0 and 1.1. */
   if (iri && !iri->content_encoding && meta_charset)
diff --git "a/src\\http.orig.c" "b/src\\http.c"
index 898e184..7066371 100644
--- "a/src\\http.orig.c"
+++ "b/src\\http.c"
@@ -3616,7 +3616,7 @@ gethttp (const struct url *u, struct url *original_url, struct http_stat *hs,
       char *tmp = strchr (type, ';');
       if (tmp)
         {
-#ifdef ENABLE_IRI
+#ifdef HAVE_ICONV
           /* sXXXav: only needed if IRI support is enabled */
           char *tmp2 = tmp + 1;
 #endif
@@ -3625,7 +3625,7 @@ gethttp (const struct url *u, struct url *original_url, struct http_stat *hs,
             --tmp;
           *tmp = '\0';
 
-#ifdef ENABLE_IRI
+#ifdef HAVE_ICONV
           /* Try to get remote encoding if needed */
           if (opt.enable_iri && !opt.encoding_remote)
             {
diff --git "a/src\\init.orig.c" "b/src\\init.c"
index e6aa673..205e8ba 100644
--- "a/src\\init.orig.c"
+++ "b/src\\init.c"
@@ -463,7 +463,7 @@ defaults (void)
 
   opt.waitretry = 10;
 
-#ifdef ENABLE_IRI
+#ifdef HAVE_ICONV
   opt.enable_iri = true;
 #else
   opt.enable_iri = false;
diff --git "a/src\\iri.orig.c" "b/src\\iri.c"
index 8be109e..e571822 100644
--- "a/src\\iri.orig.c"
+++ "b/src\\iri.c"
@@ -38,9 +38,12 @@ as that of the covered work.  */
 #ifdef HAVE_ICONV
 # include <iconv.h>
 #endif
+
+#ifdef ENABLE_IRI
 #include <idn2.h>
 #include <unicase.h>
 #include <unistr.h>
+#endif
 
 #include "utils.h"
 #include "url.h"
@@ -50,6 +53,8 @@ as that of the covered work.  */
 
 /* Note: locale encoding is kept in options struct (opt.locale) */
 
+#ifdef HAVE_ICONV
+
 /* Given a string containing "charset=XXX", return the encoding if found,
    or NULL otherwise */
 char *
@@ -235,87 +240,6 @@ locale_to_utf8 (const char *str)
   return str;
 }
 
-/* Try to "ASCII encode" UTF-8 host. Return the new domain on success or NULL
-   on error. */
-char *
-idn_encode (const struct iri *i, const char *host)
-{
-  int ret;
-  char *ascii_encoded;
-  char *utf8_encoded = NULL;
-  const char *src;
-#if IDN2_VERSION_NUMBER < 0x00140000
-  uint8_t *lower;
-  size_t len = 0;
-#endif
-
-  /* Encode to UTF-8 if not done */
-  if (!i->utf8_encode)
-    {
-      if (!remote_to_utf8 (i, host, &utf8_encoded))
-          return NULL;  /* Nothing to encode or an error occured */
-      src = utf8_encoded;
-    }
-  else
-    src = host;
-
-#if IDN2_VERSION_NUMBER >= 0x00140000
-  /* IDN2_TRANSITIONAL implies input NFC encoding */
-  if ((ret = idn2_lookup_u8 ((uint8_t *) src, (uint8_t **) &ascii_encoded, IDN2_NONTRANSITIONAL)) != IDN2_OK)
-    {
-      logprintf (LOG_VERBOSE, _("idn_encode failed (%d): %s\n"), ret,
-                 quote (idn2_strerror (ret)));
-    }
-#else
-  /* we need a conversion to lowercase */
-  lower = u8_tolower ((uint8_t *) src, u8_strlen ((uint8_t *) src) + 1, 0, UNINORM_NFKC, NULL, &len);
-  if (!lower)
-    {
-      logprintf (LOG_VERBOSE, _("Failed to convert to lower: %d: %s\n"),
-                 errno, quote (src));
-      xfree (utf8_encoded);
-      return NULL;
-    }
-
-  if ((ret = idn2_lookup_u8 (lower, (uint8_t **) &ascii_encoded, IDN2_NFC_INPUT)) != IDN2_OK)
-    {
-      logprintf (LOG_VERBOSE, _("idn_encode failed (%d): %s\n"), ret,
-                 quote (idn2_strerror (ret)));
-    }
-
-  xfree (lower);
-#endif
-
-  xfree (utf8_encoded);
-
-  return ret == IDN2_OK ? ascii_encoded : NULL;
-}
-
-/* Try to decode an "ASCII encoded" host. Return the new domain in the locale
-   on success or NULL on error. */
-char *
-idn_decode (const char *host)
-{
-/*
-  char *new;
-  int ret;
-
-  ret = idn2_register_u8 (NULL, host, (uint8_t **) &new, 0);
-  if (ret != IDN2_OK)
-    {
-      logprintf (LOG_VERBOSE, _("idn2_register_u8 failed (%d): %s: %s\n"), ret,
-                 quote (idn2_strerror (ret)), host);
-      return NULL;
-    }
-
-  return new;
-*/
-  /* idn2_register_u8() just works label by label.
-   * That is pretty much overhead for just displaying the original ulabels.
-   * To keep at least the debug output format, return a cloned host. */
-  return xstrdup(host);
-}
-
 /* Try to transcode string str from remote encoding to UTF-8. On success, *new
    contains the transcoded string. *new content is unspecified otherwise. */
 bool
@@ -354,6 +278,41 @@ remote_to_utf8 (const struct iri *iri, const char *str, char **new)
   return ret;
 }
 
+/* Set uri_encoding of struct iri i. If a remote encoding was specified, use
+   it unless force is true. */
+void
+set_uri_encoding (struct iri *i, const char *charset, bool force)
+{
+  DEBUGP (("URI encoding = %s\n", charset ? quote (charset) : "None"));
+  if (!force && opt.encoding_remote)
+    return;
+  if (i->uri_encoding)
+    {
+      if (charset && !c_strcasecmp (i->uri_encoding, charset))
+        return;
+      xfree (i->uri_encoding);
+    }
+
+  i->uri_encoding = charset ? xstrdup (charset) : NULL;
+}
+
+/* Set content_encoding of struct iri i. */
+void
+set_content_encoding (struct iri *i, const char *charset)
+{
+  DEBUGP (("URI content encoding = %s\n", charset ? quote (charset) : "None"));
+  if (opt.encoding_remote)
+    return;
+  if (i->content_encoding)
+    {
+      if (charset && !c_strcasecmp (i->content_encoding, charset))
+        return;
+      xfree (i->content_encoding);
+    }
+
+  i->content_encoding = charset ? xstrdup (charset) : NULL;
+}
+
 /* Allocate a new iri structure and return a pointer to it. */
 struct iri *
 iri_new (void)
@@ -390,37 +349,89 @@ iri_free (struct iri *i)
     }
 }
 
-/* Set uri_encoding of struct iri i. If a remote encoding was specified, use
-   it unless force is true. */
-void
-set_uri_encoding (struct iri *i, const char *charset, bool force)
+#endif
+
+#ifdef ENABLE_IRI
+
+/* Try to "ASCII encode" UTF-8 host. Return the new domain on success or NULL
+   on error. */
+char *
+idn_encode (const struct iri *i, const char *host)
 {
-  DEBUGP (("URI encoding = %s\n", charset ? quote (charset) : "None"));
-  if (!force && opt.encoding_remote)
-    return;
-  if (i->uri_encoding)
+  int ret;
+  char *ascii_encoded;
+  char *utf8_encoded = NULL;
+  const char *src;
+#if IDN2_VERSION_NUMBER < 0x00140000
+  uint8_t *lower;
+  size_t len = 0;
+#endif
+
+  /* Encode to UTF-8 if not done */
+  if (!i->utf8_encode)
     {
-      if (charset && !c_strcasecmp (i->uri_encoding, charset))
-        return;
-      xfree (i->uri_encoding);
+      if (!remote_to_utf8 (i, host, &utf8_encoded))
+          return NULL;  /* Nothing to encode or an error occured */
+      src = utf8_encoded;
     }
+  else
+    src = host;
 
-  i->uri_encoding = charset ? xstrdup (charset) : NULL;
+#if IDN2_VERSION_NUMBER >= 0x00140000
+  /* IDN2_TRANSITIONAL implies input NFC encoding */
+  if ((ret = idn2_lookup_u8 ((uint8_t *) src, (uint8_t **) &ascii_encoded, IDN2_NONTRANSITIONAL)) != IDN2_OK)
+    {
+      logprintf (LOG_VERBOSE, _("idn_encode failed (%d): %s\n"), ret,
+                 quote (idn2_strerror (ret)));
+    }
+#else
+  /* we need a conversion to lowercase */
+  lower = u8_tolower ((uint8_t *) src, u8_strlen ((uint8_t *) src) + 1, 0, UNINORM_NFKC, NULL, &len);
+  if (!lower)
+    {
+      logprintf (LOG_VERBOSE, _("Failed to convert to lower: %d: %s\n"),
+                 errno, quote (src));
+      xfree (utf8_encoded);
+      return NULL;
+    }
+
+  if ((ret = idn2_lookup_u8 (lower, (uint8_t **) &ascii_encoded, IDN2_NFC_INPUT)) != IDN2_OK)
+    {
+      logprintf (LOG_VERBOSE, _("idn_encode failed (%d): %s\n"), ret,
+                 quote (idn2_strerror (ret)));
+    }
+
+  xfree (lower);
+#endif
+
+  xfree (utf8_encoded);
+
+  return ret == IDN2_OK ? ascii_encoded : NULL;
 }
 
-/* Set content_encoding of struct iri i. */
-void
-set_content_encoding (struct iri *i, const char *charset)
+/* Try to decode an "ASCII encoded" host. Return the new domain in the locale
+   on success or NULL on error. */
+char *
+idn_decode (const char *host)
 {
-  DEBUGP (("URI content encoding = %s\n", charset ? quote (charset) : "None"));
-  if (opt.encoding_remote)
-    return;
-  if (i->content_encoding)
+/*
+  char *new;
+  int ret;
+
+  ret = idn2_register_u8 (NULL, host, (uint8_t **) &new, 0);
+  if (ret != IDN2_OK)
     {
-      if (charset && !c_strcasecmp (i->content_encoding, charset))
-        return;
-      xfree (i->content_encoding);
+      logprintf (LOG_VERBOSE, _("idn2_register_u8 failed (%d): %s: %s\n"), ret,
+                 quote (idn2_strerror (ret)), host);
+      return NULL;
     }
 
-  i->content_encoding = charset ? xstrdup (charset) : NULL;
+  return new;
+*/
+  /* idn2_register_u8() just works label by label.
+   * That is pretty much overhead for just displaying the original ulabels.
+   * To keep at least the debug output format, return a cloned host. */
+  return xstrdup(host);
 }
+
+#endif
diff --git "a/src\\iri.orig.h" "b/src\\iri.h"
index ba64a27..12d76d7 100644
--- "a/src\\iri.orig.h"
+++ "b/src\\iri.h"
@@ -38,24 +38,20 @@ struct iri {
   bool utf8_encode;        /* Will/Is the current url encoded in utf8 */
 };
 
-#ifdef ENABLE_IRI
-
-# include <idn2.h>
+#ifdef HAVE_ICONV
 
 char *parse_charset (const char *str);
 const char *find_locale (void);
 bool check_encoding_name (const char *encoding);
 const char *locale_to_utf8 (const char *str);
-char *idn_encode (const struct iri *i, const char *host);
-char *idn_decode (const char *host);
 bool remote_to_utf8 (const struct iri *i, const char *str, char **new);
+void set_uri_encoding (struct iri *i, const char *charset, bool force);
+void set_content_encoding (struct iri *i, const char *charset);
 struct iri *iri_new (void);
 struct iri *iri_dup (const struct iri *);
 void iri_free (struct iri *i);
-void set_uri_encoding (struct iri *i, const char *charset, bool force);
-void set_content_encoding (struct iri *i, const char *charset);
 
-#else /* ENABLE_IRI */
+#else
 
 extern struct iri dummy_iri;
 
@@ -63,15 +59,28 @@ extern struct iri dummy_iri;
 #define find_locale()               NULL
 #define check_encoding_name(str)    false
 #define locale_to_utf8(str)         (str)
-#define idn_encode(a,b)             NULL
-#define idn_decode(str)             NULL
-#define idn2_free(str)              ((void)0)
 #define remote_to_utf8(a,b,c)       false
+#define set_uri_encoding(a,b,c)
+#define set_content_encoding(a,b)
 #define iri_new()                   (&dummy_iri)
 #define iri_dup(a)                  (&dummy_iri)
 #define iri_free(a)
-#define set_uri_encoding(a,b,c)
-#define set_content_encoding(a,b)
+
+#endif
+
+
+#ifdef ENABLE_IRI
+
+# include <idn2.h>
+
+char *idn_encode (const struct iri *i, const char *host);
+char *idn_decode (const char *host);
+
+#else /* ENABLE_IRI */
+
+#define idn_encode(a,b)             NULL
+#define idn_decode(str)             NULL
+#define idn2_free(str)              ((void)0)
 
 #endif /* ENABLE_IRI */
 #endif /* IRI_H */
diff --git "a/src\\main.orig.c" "b/src\\main.c"
index 581a33d..26a3365 100644
--- "a/src\\main.orig.c"
+++ "b/src\\main.c"
@@ -84,7 +84,7 @@ as that of the covered work.  */
 # define PATH_SEPARATOR '/'
 #endif
 
-#ifndef ENABLE_IRI
+#ifndef HAVE_ICONV
 struct iri dummy_iri;
 #endif
 
@@ -1792,7 +1792,7 @@ for details.\n\n"));
           }
     }
 
-#ifdef ENABLE_IRI
+#ifdef HAVE_ICONV
   if (opt.enable_iri)
     {
       if (opt.locale && !check_encoding_name (opt.locale))
diff --git "a/src\\Makefile.orig.am" "b/src\\Makefile.am"
index 28c0be2..b17f733 100644
--- "a/src\\Makefile.orig.am"
+++ "b/src\\Makefile.am"
@@ -31,9 +31,7 @@
 # Version: @VERSION@
 #
 
-if IRI_IS_ENABLED
 IRI_OBJ = iri.c
-endif
 
 if METALINK_IS_ENABLED
 METALINK_OBJ = metalink.c
diff --git "a/src\\Makefile.orig.in" "b/src\\Makefile.in"
index e72738c..912f983 100644
--- "a/src\\Makefile.orig.in"
+++ "b/src\\Makefile.in"
@@ -263,7 +263,7 @@ am__libunittest_a_SOURCES_DIST = connect.c convert.c cookies.c ftp.c \
 	sysdep.h url.h warc.h utils.h wget.h iri.h exits.h version.h \
 	metalink.h xattr.h test.c test.h
 @WITH_XATTR_TRUE@am__objects_1 = libunittest_a-xattr.$(OBJEXT)
-@IRI_IS_ENABLED_TRUE@am__objects_2 = libunittest_a-iri.$(OBJEXT)
+am__objects_2 = libunittest_a-iri.$(OBJEXT)
 @METALINK_IS_ENABLED_TRUE@am__objects_3 =  \
 @METALINK_IS_ENABLED_TRUE@	libunittest_a-metalink.$(OBJEXT)
 am__objects_4 = libunittest_a-connect.$(OBJEXT) \
@@ -305,7 +305,7 @@ am__wget_SOURCES_DIST = connect.c convert.c cookies.c ftp.c css_.c \
 	sysdep.h url.h warc.h utils.h wget.h iri.h exits.h version.h \
 	metalink.h xattr.h
 @WITH_XATTR_TRUE@am__objects_5 = xattr.$(OBJEXT)
-@IRI_IS_ENABLED_TRUE@am__objects_6 = iri.$(OBJEXT)
+am__objects_6 = iri.$(OBJEXT)
 @METALINK_IS_ENABLED_TRUE@am__objects_7 = metalink.$(OBJEXT)
 am_wget_OBJECTS = connect.$(OBJEXT) convert.$(OBJEXT) \
 	cookies.$(OBJEXT) ftp.$(OBJEXT) css_.$(OBJEXT) \
@@ -1428,7 +1428,7 @@ target_alias = @target_alias@
 top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
-@IRI_IS_ENABLED_TRUE@IRI_OBJ = iri.c
+IRI_OBJ = iri.c
 @METALINK_IS_ENABLED_TRUE@METALINK_OBJ = metalink.c
 @WITH_XATTR_TRUE@XATTR_OBJ = xattr.c
 EXTRA_DIST = css.l css.c css_.c build_info.c.in
diff --git "a/src\\recur.orig.c" "b/src\\recur.c"
index 42b4eb1..100e3eb 100644
--- "a/src\\recur.orig.c"
+++ "b/src\\recur.c"
@@ -243,7 +243,7 @@ retrieve_tree (struct url *start_url_parsed, struct iri *pi)
       i->utf8_encode = pi->utf8_encode;
 #undef COPYSTR
     }
-#ifdef ENABLE_IRI
+#ifdef HAVE_ICONV
   else
     set_uri_encoding (i, opt.locale, true);
 #endif
diff --git "a/src\\retr.orig.c" "b/src\\retr.c"
index 5ba744f..d01ca7c 100644
--- "a/src\\retr.orig.c"
+++ "b/src\\retr.c"
@@ -873,7 +873,7 @@ retrieve_url (struct url * orig_parsed, const char *origurl, char **file,
       xfree (mynewloc);
       mynewloc = construced_newloc;
 
-#ifdef ENABLE_IRI
+#ifdef HAVE_ICONV
       /* Reset UTF-8 encoding state, set the URI encoding and reset
          the content encoding. */
       iri->utf8_encode = opt.enable_iri;
@@ -1069,7 +1069,7 @@ retrieve_from_file (const char *file, bool html, int *count)
       if (dt & TEXTHTML)
         html = true;
 
-#ifdef ENABLE_IRI
+#ifdef HAVE_ICONV
       /* If we have a found a content encoding, use it.
        * ( == is okay, because we're checking for identical object) */
       if (iri->content_encoding != opt.locale)
