+#ifdef SUPPORT_I18N_2008
+/* Avoid lowercasing plain-ascii domains */
+if (!string_is_utf8(utf8))
+ return string_copy(utf8);
+
+/* Only lowercase is accepted by the library call. A pity since we lose
+any mixed-case annotation. This does not really matter for a domain. */
+ {
+ uschar c;
+ for (s1 = s = US utf8; (c = *s1); s1++) if (!(c & 0x80) && isupper(c))
+ {
+ s = string_copy(utf8);
+ for (s1 = s + (s1 - utf8); (c = *s1); s1++) if (!(c & 0x80) && isupper(c))
+ *s1 = tolower(c);
+ break;
+ }
+ }
+if ((rc = idn2_lookup_u8((const uint8_t *) s, &s1, IDN2_NFC_INPUT)) != IDN2_OK)
+ {
+ if (err) *err = US idn2_strerror(rc);
+ return NULL;
+ }
+#else