[Bug 159017] URLs are converted to lower case

Sebastian Sauer mail at dipe.org
Sun Mar 9 23:04:42 CET 2008


------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
         
http://bugs.kde.org/show_bug.cgi?id=159017         




------- Additional Comments From mail dipe org  2008-03-09 23:04 -------
Quit interesting case. The code in question is in http://websvn.kde.org/trunk/KDE/kdebase/workspace/plasma/runners/locations/locationrunner.cpp?view=markup

void processUrl(KUrl &url, const QString &term)
{
    if (url.protocol().isEmpty()) {
        int idx = term.indexOf('/');
        url.clear();
        url.setProtocol("http");
        url.setHost(term.left(idx));
        if (idx != -1) {
            url.setPath(term.mid(idx));
        }
    }
}

Here the testcases;

KUrl u1("www.Abc.de");
kDebug()<<u1.url(); //"www.Abc.de"
u1.setProtocol("http");
kDebug()<<u1.url(); //"http://www.abc.de"

KUrl u2;
u2.setProtocol("http");
u2.setHost("www.Abc.de");
kDebug()<<u2.url(); //"http://www.abc.de"

KUrl u3;
u3.setScheme("http");
u3.setHost("www.Abc.de");
kDebug()<<u3.url(); //"http://www.abc.de"

The case;

iirc a few yearsago we had a discussion if the hostname is really always lowercased. While iirc the w3c-spec says yes, this is false cause there are quit some protocols like donkey and magnet that use the hostname for a filename-reference and therefore _need_ to be case-sensitive.

That time somehow we came to the conclusion that KUrl isn't only about url's as the RFC define them and therefore KUrl got patched to be able to deal with the hostname in a case-sensitive way by Petter E. Stokke.

Now the situation is, that we adopted QUrl, our code got removed and we are again case-insensitive :-/

The result;

I've no idea there and iirc the patch by Petter was rather big and not easy to understand :-(


More information about the Panel-devel mailing list