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
QtWS25 Last Chance

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 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

    JKSHJ 1 Reply Last reply
    0
    • D drwho

      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

      JKSHJ Offline
      JKSHJ Offline
      JKSH
      Moderators
      wrote on 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 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

        • Login

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