diff -u -r kdelibs-3.2.3.orig/kdecore/kidna.cpp kdelibs-3.2.3/kdecore/kidna.cpp --- kdelibs-3.2.3.orig/kdecore/kidna.cpp 2004-02-28 03:49:49.000000000 -0600 +++ kdelibs-3.2.3/kdecore/kidna.cpp 2006-02-07 01:16:28.000000000 -0600 @@ -21,6 +21,7 @@ #include "kidna.h" +#include #include #include "ltdl.h" @@ -65,6 +66,22 @@ KIDNA_lib_load_failed = false; // Succes } +static QStringList *KIDNA_idnDomains = 0; + +static bool idnSupportForHost(const QString &host) +{ + if (!KIDNA_idnDomains) + { + const char *kde_use_idn = getenv("KDE_USE_IDN"); + if (!kde_use_idn) + kde_use_idn = "at:ch:cn:de:dk:kr:jp:li:no:se:tw"; + KIDNA_idnDomains = new QStringList(QStringList::split(':', QString::fromLatin1(kde_use_idn).lower())); + } + + QString tld = host.mid(host.findRev('.')+1).lower(); + return KIDNA_idnDomains->contains(tld); +} + QCString KIDNA::toAsciiCString(const QString &idna) { int l = idna.length(); @@ -86,7 +103,7 @@ KIDNA_load_lib(); } - if (KIDNA_lib_load_failed) + if (KIDNA_lib_load_failed || !idnSupportForHost(idna)) { return 0; // Can't convert } @@ -132,7 +149,7 @@ KIDNA_load_lib(); } - if (KIDNA_lib_load_failed) + if (KIDNA_lib_load_failed || !idnSupportForHost(idna)) { return QString::null; // Can't convert } @@ -164,7 +181,7 @@ KIDNA_load_lib(); } - if (KIDNA_lib_load_failed) + if (KIDNA_lib_load_failed || !idnSupportForHost(idna)) { return idna.lower(); // Return as is } diff -u -r kdelibs-3.2.3.orig/kio/kssl/ksslpeerinfo.cc kdelibs-3.2.3/kio/kssl/ksslpeerinfo.cc --- kdelibs-3.2.3.orig/kio/kssl/ksslpeerinfo.cc 2003-06-02 02:05:20.000000000 -0500 +++ kdelibs-3.2.3/kio/kssl/ksslpeerinfo.cc 2006-02-07 01:16:36.000000000 -0600 @@ -30,6 +30,7 @@ #include #include #include +#include "kidna.h" #include "ksslx509map.h" @@ -59,7 +60,7 @@ while(d->peerHost.endsWith(".")) d->peerHost.truncate(d->peerHost.length()-1); - d->peerHost = d->peerHost.lower(); + d->peerHost = KIDNA::toAscii(d->peerHost); } bool KSSLPeerInfo::certMatchesAddress() {