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. Is there an equivalent of curl_easy_escape()?
Forum Updated to NodeBB v4.3 + New Features

Is there an equivalent of curl_easy_escape()?

Scheduled Pinned Locked Moved Solved General and Desktop
4 Posts 2 Posters 324 Views 1 Watching
  • 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.
  • SteMMoS Offline
    SteMMoS Offline
    SteMMo
    wrote on last edited by
    #1

    Hi all,
    I'm rewriting a simple Linux C application that uses curl library.
    In particular the original code filters the json data with curl_easy_escape(), so I'm wondering if Qt has an equivalent call.

    Thanks, regards

    1 Reply Last reply
    0
    • Christian EhrlicherC Online
      Christian EhrlicherC Online
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on last edited by
      #4

      You can also take a look at QUrl::toPercentEncoding() which takes a QString and returns a QByteArray. Looks like this works on strings without expecting a valid url.

      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
      Visit the Qt Academy at https://academy.qt.io/catalog

      1 Reply Last reply
      1
      • Christian EhrlicherC Online
        Christian EhrlicherC Online
        Christian Ehrlicher
        Lifetime Qt Champion
        wrote on last edited by
        #2

        What does curl_easy_escape has to do with json?

        This function converts the given input string to a URL encoded string and returns that as a new allocated string

        --> Use QUrl

        Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
        Visit the Qt Academy at https://academy.qt.io/catalog

        1 Reply Last reply
        0
        • SteMMoS Offline
          SteMMoS Offline
          SteMMo
          wrote on last edited by
          #3

          It converts the data string - it is a server requrement.

          1 Reply Last reply
          0
          • Christian EhrlicherC Online
            Christian EhrlicherC Online
            Christian Ehrlicher
            Lifetime Qt Champion
            wrote on last edited by
            #4

            You can also take a look at QUrl::toPercentEncoding() which takes a QString and returns a QByteArray. Looks like this works on strings without expecting a valid url.

            Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
            Visit the Qt Academy at https://academy.qt.io/catalog

            1 Reply Last reply
            1

            • Login

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