summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/corelib/io/qurlidna.cpp4
-rw-r--r--tests/auto/corelib/io/qurlinternal/tst_qurlinternal.cpp8
2 files changed, 10 insertions, 2 deletions
diff --git a/src/corelib/io/qurlidna.cpp b/src/corelib/io/qurlidna.cpp
index 46553d38a5..eae4289cf5 100644
--- a/src/corelib/io/qurlidna.cpp
+++ b/src/corelib/io/qurlidna.cpp
@@ -2415,8 +2415,8 @@ static bool qt_is_idn_enabled(const QString &domain)
return false;
int len = domain.size() - idx - 1;
- QString tldString(domain.constData() + idx + 1, len);
- qt_nameprep(&tldString, 0);
+ QString tldString = qt_ACE_do(QString::fromRawData(domain.constData() + idx + 1, len), ToAceOnly, ForbidLeadingDot);
+ len = tldString.size();
const QChar *tld = tldString.constData();
diff --git a/tests/auto/corelib/io/qurlinternal/tst_qurlinternal.cpp b/tests/auto/corelib/io/qurlinternal/tst_qurlinternal.cpp
index 753a679d4c..8c9627b220 100644
--- a/tests/auto/corelib/io/qurlinternal/tst_qurlinternal.cpp
+++ b/tests/auto/corelib/io/qurlinternal/tst_qurlinternal.cpp
@@ -675,6 +675,14 @@ void tst_QUrlInternal::ace_testsuite()
QCOMPARE(QUrl::fromAce(domain.toLatin1()), fromace + suffix);
QCOMPARE(QUrl::fromAce(QUrl::toAce(domain)), unicode + suffix);
+ QUrl u;
+ u.setHost(domain);
+ QVERIFY(u.isValid());
+ QCOMPARE(u.host(), unicode + suffix);
+ QCOMPARE(u.host(QUrl::EncodeUnicode), toace + suffix);
+ QCOMPARE(u.toEncoded(), "//" + toace.toLatin1() + suffix);
+ QCOMPARE(u.toDisplayString(), "//" + unicode + suffix);
+
domain = in + (suffix ? ".troll.No" : "");
QCOMPARE(QString::fromLatin1(QUrl::toAce(domain)), toace + suffix);
if (fromace != ".")