Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. percent encoding differs in QUrl in Qt4 vs Qt5

percent encoding differs in QUrl in Qt4 vs Qt5

Scheduled Pinned Locked Moved General and Desktop
qurlqt4qt5
3 Posts 2 Posters 1.5k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    drwho
    wrote on 4 Jun 2015, 15:47 last edited by
    #1

    Anyone know why the percent encoding differs in QUrl in Qt4 vs Qt5. It appears to be wrong in Qt4....

    QUrl url(QString(John's iPho))

    actual bytes in QString
    4A 6F 68 6E E2 80 99 73 20 69 50 68 6F

    The ' is uft = E2 80 99

    QUrl in qt4 yields
    John%C3%A2%C2%80%C2%99s%20iPho

    QUrl in qt5.3.1 yields (correct)
    John%E2%80%99s%20iPho

    J 1 Reply Last reply 5 Jun 2015, 11:30
    0
    • D drwho
      4 Jun 2015, 15:47

      Anyone know why the percent encoding differs in QUrl in Qt4 vs Qt5. It appears to be wrong in Qt4....

      QUrl url(QString(John's iPho))

      actual bytes in QString
      4A 6F 68 6E E2 80 99 73 20 69 50 68 6F

      The ' is uft = E2 80 99

      QUrl in qt4 yields
      John%C3%A2%C2%80%C2%99s%20iPho

      QUrl in qt5.3.1 yields (correct)
      John%E2%80%99s%20iPho

      J Offline
      J Offline
      JKSH
      Moderators
      wrote on 5 Jun 2015, 11:30 last edited by
      #2

      @drwho said:

      Anyone know why the percent encoding differs in QUrl in Qt4 vs Qt5. It appears to be wrong in Qt4....

      That means there was a bug in Qt 4, and the bug was fixed in Qt 5.

      Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

      1 Reply Last reply
      0
      • D Offline
        D Offline
        drwho
        wrote on 9 Jun 2015, 16:59 last edited by
        #3

        The QString is being formed from a QByteArray. When I make the QString via

        QString::fromUtf8(QByteArray)

        QUrl in Qt4 correctly percent encodes the QString. I don't think there is a bug in QUrl in Qt4, I guess QUrl in Qt5 is more tolerant.

        1 Reply Last reply
        0

        2/3

        5 Jun 2015, 11:30

        • Login

        • Login or register to search.
        2 out of 3
        • First post
          2/3
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved