Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-44390

QUrl::​topLevelDomain returns wrong tld

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P3: Somewhat important
    • 5.4.2, 5.5.0
    • 5.4.0
    • None
    • Linux Debian Jessie i686.
      Qt Creator 3.3.0
    • afb52763aa759b3b60be2816212af04d0063595c

    Description

      Hi,

      It seems that in some cases, QUrl::​topLevelDomain returns a wrong top level domain.
      Here's a sample file (console project)

      main.cpp
      #include <QCoreApplication>
      #include <QUrl>
      #include <QDebug>
      
      int main(int argc, char *argv[])
      {
          QCoreApplication a(argc, argv);
      
          QString url("http://www.homeip.net");
          QUrl qUrl(url);
          qDebug() << "Not working : wrong tld returned";
          qDebug() << "Url1 : " << url << "TLD : " <<  qUrl.topLevelDomain();
      
          url = "http://www.blogspot.fr";
          qUrl.setUrl(url);
          qDebug() << "Not working : wrong tld returned";
          qDebug() << "Url2 : " << url << "TLD : " <<  qUrl.topLevelDomain();
      
          url = "http://www.google.fr";
          qUrl.setUrl(url);
          qDebug() << "Working sample";
          qDebug() << "Url3 : " << url << "TLD : " <<  qUrl.topLevelDomain();
      
          return a.exec();
      }
      

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            thiago Thiago Macieira
            rdd RDD
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes