diff options
author | Olivier Goffart <ogoffart@trolltech.com> | 2009-10-15 12:53:06 (GMT) |
---|---|---|
committer | Olivier Goffart <ogoffart@trolltech.com> | 2009-10-15 12:53:06 (GMT) |
commit | 694976df8fe1866b2496dade643da634656d7b32 (patch) | |
tree | 03eb52bf26b8be42dee67fd84d0d88eb56f9864f /src/corelib/io | |
parent | aa24e2390124707db6720c148ff7e1d4edad795d (diff) | |
parent | a814aba657288942b5beed70a2110446420f981c (diff) | |
download | Qt-694976df8fe1866b2496dade643da634656d7b32.zip Qt-694976df8fe1866b2496dade643da634656d7b32.tar.gz Qt-694976df8fe1866b2496dade643da634656d7b32.tar.bz2 |
Merge commit 'a814aba657288942b5beed70a2110446420f981c' into origin-4.6
Diffstat (limited to 'src/corelib/io')
-rw-r--r-- | src/corelib/io/qurl.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/corelib/io/qurl.cpp b/src/corelib/io/qurl.cpp index 22d0019..6001d9d 100644 --- a/src/corelib/io/qurl.cpp +++ b/src/corelib/io/qurl.cpp @@ -3874,10 +3874,15 @@ QByteArray QUrlPrivate::toEncoded(QUrl::FormattingOptions options) const } } - if (host.startsWith(QLatin1Char('['))) + if (host.startsWith(QLatin1Char('['))) { url += host.toLatin1(); - else + } else if (host.contains(QLatin1Char(':'))) { + url += '['; + url += host.toLatin1(); + url += ']'; + } else { url += QUrl::toAce(host); + } if (!(options & QUrl::RemovePort) && port != -1) { url += ':'; url += QString::number(port).toAscii(); |