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

QUrl::fromUserInput [QUrl::fromEncoded] does not work if string over 70 characters

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • P3: Somewhat important
    • None
    • 4.6.2, 4.7.2
    • Core: URL Handling
    • None
    • Desktop

    Description

      STEPS LEADING TO PROBLEM:

      #include <QtCore/QtCore>
      int main(int argc, char **argv) {
          QCoreApplication a(argc, argv);
      
          qDebug() << "test1:" << QUrl::fromEncoded(QString("http://123456789a1a2a3a4a5a6a7a8a9b1b2b3b4b5b6b7b8b9c1c2c3c4c5c6c7c8c9d.pep").toUtf8(), QUrl::TolerantMode).toString().toAscii().data();
          qDebug() << "test2:" << QUrl::fromUserInput(QString("123456789a1a2a3a4a5a6a7a8a9b1b2b3b4b5b6b7b8b9c1c2c3c4c5c6c7c8c9d.pep")).toString().toAscii().data();
          qDebug() << "test3:" << QUrl::fromUserInput(QString("http://123456789a1a2a3a4a5a6a7a8a9b1b2b3b4b5b6b7b8b9c1c2c3c4c5c6c7c8c9d.pep")).toString().toAscii().data();
      }
      

      EXPECTED OUTCOME:
      test1: http://123456789a1a2a3a4a5a6a7a8a9b1b2b3b4b5b6b7b8b9c1c2c3c4c5c6c7c8c9d.pep
      test2: http://123456789a1a2a3a4a5a6a7a8a9b1b2b3b4b5b6b7b8b9c1c2c3c4c5c6c7c8c9d.pep
      test3: http://123456789a1a2a3a4a5a6a7a8a9b1b2b3b4b5b6b7b8b9c1c2c3c4c5c6c7c8c9d.pep

      ACTUAL OUTCOME:
      test1: http:
      test2:
      test3: http://http//123456789a1a2a3a4a5a6a7a8a9b1b2b3b4b5b6b7b8b9c1c2c3c4c5c6c7c8c9d.pep

      Attachments

        1. urlissue.zip
          0.9 kB
          Santosh Kumar
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            earthdomain Earth Domain (Inactive)
            romaxa Oleg Romashin
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes