Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. URL Encoder

URL Encoder

Scheduled Pinned Locked Moved C / C++ / MFC
c++
10 Posts 4 Posters 2 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.
  • J Offline
    J Offline
    John Bosko
    wrote on last edited by
    #1

    Hi, Please can someone tell me, where do I get the URL Encoder for C++.:( Many Thanks, John

    D A 2 Replies Last reply
    0
    • J John Bosko

      Hi, Please can someone tell me, where do I get the URL Encoder for C++.:( Many Thanks, John

      D Offline
      D Offline
      Dominik Reichl
      wrote on last edited by
      #2

      Err... what the hell is an "URL Encoder"? Could you give an example what it should do? :confused: -Dominik

      J 1 Reply Last reply
      0
      • D Dominik Reichl

        Err... what the hell is an "URL Encoder"? Could you give an example what it should do? :confused: -Dominik

        J Offline
        J Offline
        John Bosko
        wrote on last edited by
        #3

        Hi Dominik, Apparently I want to encode a string in C++ and then store the same in a char field. Thanks, John

        D 1 Reply Last reply
        0
        • J John Bosko

          Hi Dominik, Apparently I want to encode a string in C++ and then store the same in a char field. Thanks, John

          D Offline
          D Offline
          Dominik Reichl
          wrote on last edited by
          #4

          What does "encode" mean in this context?

          J 1 Reply Last reply
          0
          • D Dominik Reichl

            What does "encode" mean in this context?

            J Offline
            J Offline
            John Bosko
            wrote on last edited by
            #5

            Encode would imply parsing a string with values. ex. if the string was www.yahoo.com before encryption, after encryption it would be something like www&&yahoo^com. the characters would be replaced.

            D 1 Reply Last reply
            0
            • J John Bosko

              Encode would imply parsing a string with values. ex. if the string was www.yahoo.com before encryption, after encryption it would be something like www&&yahoo^com. the characters would be replaced.

              D Offline
              D Offline
              Dominik Reichl
              wrote on last edited by
              #6

              So you need a function which does the same as the function escape("") in JavaScript? I don't know any existing source which does this. But it should not be that hard to replace some characters with some other, especially if you use CString or STL strings.

              J 1 Reply Last reply
              0
              • D Dominik Reichl

                So you need a function which does the same as the function escape("") in JavaScript? I don't know any existing source which does this. But it should not be that hard to replace some characters with some other, especially if you use CString or STL strings.

                J Offline
                J Offline
                John Bosko
                wrote on last edited by
                #7

                Yes, I need something like escape in java!!! Please can you help me out with it, I am pretty newbie in C++. Thanks Dominik, John

                D 1 Reply Last reply
                0
                • J John Bosko

                  Yes, I need something like escape in java!!! Please can you help me out with it, I am pretty newbie in C++. Thanks Dominik, John

                  D Offline
                  D Offline
                  Dominik Reichl
                  wrote on last edited by
                  #8

                  The easiest way is using CStrings. Create a CString object and copy the string you want to encode in the CString.

                  CString str;
                  str = "www.yahoo.com";

                  Now, replace all the characters you want to encode.

                  str.Replace(" ", "%20");

                  This would encode all spaces to the correct %20 code. Now you would have to do this for all characters... For all codes see the following sites: http://www.macromedia.com/support/flash/ts/documents/url_encoding.htm[^] http://www.blooberry.com/indexdot/html/topics/urlencoding.htm[^] http://ops.tamu.edu/nipsy/url/common_encodings.html[^] :-D -Dominik

                  C 1 Reply Last reply
                  0
                  • D Dominik Reichl

                    The easiest way is using CStrings. Create a CString object and copy the string you want to encode in the CString.

                    CString str;
                    str = "www.yahoo.com";

                    Now, replace all the characters you want to encode.

                    str.Replace(" ", "%20");

                    This would encode all spaces to the correct %20 code. Now you would have to do this for all characters... For all codes see the following sites: http://www.macromedia.com/support/flash/ts/documents/url_encoding.htm[^] http://www.blooberry.com/indexdot/html/topics/urlencoding.htm[^] http://ops.tamu.edu/nipsy/url/common_encodings.html[^] :-D -Dominik

                    C Offline
                    C Offline
                    carrie
                    wrote on last edited by
                    #9

                    Just as an aside through boredom theres also encoding of IP addresses. Its pretty stupid but quirky in a bored sort of way. Its basically turning each decimal octet into a hex string or octal string. You can find out about that here - http://www.pc-help.org/obscure.htm#hexip boredom is a bad thing on a board like this :)

                    1 Reply Last reply
                    0
                    • J John Bosko

                      Hi, Please can someone tell me, where do I get the URL Encoder for C++.:( Many Thanks, John

                      A Offline
                      A Offline
                      Anders Molin
                      wrote on last edited by
                      #10

                      Use the InternetCanonicalizeUrl() function ;) - Anders Money talks, but all mine ever says is "Goodbye!"

                      1 Reply Last reply
                      0
                      Reply
                      • Reply as topic
                      Log in to reply
                      • Oldest to Newest
                      • Newest to Oldest
                      • Most Votes


                      • Login

                      • Don't have an account? Register

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • World
                      • Users
                      • Groups