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 parseing \ encoding

URL parseing \ encoding

Scheduled Pinned Locked Moved C / C++ / MFC
c++javascriptquestionlearning
2 Posts 2 Posters 0 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
    Jared Allen
    wrote on last edited by
    #1

    I need to do the same thing that the javascript unescape function does but in C++. Is there a library function or , some class that can do this for me? e.g hello+this+is+the+message would become: hello this is the message but of course there are all the special characters %0D ect Thanks. JAred.

    J 1 Reply Last reply
    0
    • J Jared Allen

      I need to do the same thing that the javascript unescape function does but in C++. Is there a library function or , some class that can do this for me? e.g hello+this+is+the+message would become: hello this is the message but of course there are all the special characters %0D ect Thanks. JAred.

      J Offline
      J Offline
      James Spibey
      wrote on last edited by
      #2

      The URLUnEscapse function will do it for you but it requires Windows 2000 or IE5 to be installed see following MSDN docs

      UrlUnEscape
      [This is preliminary documentation and subject to change.]

      Converts escape sequences back into ordinary characters.

      HRESULT UrlUnEscape(
      LPTSTR pszURL,
      LPTSTR pszUnEscaped,
      LPDWORD pcchUnEscaped,
      DWORD dwFlags
      );

      Parameters
      pszURL
      [in/out] Pointer to a NULL-terminated string with the URL. If dwFlags is set to URL_UNESCAPE_INPLACE, the converted string is returned through this parameter.
      pszUnEscaped
      [out] Pointer to a NULL-terminated string containing the unescaped version of pszURL. If URL_UNESCAPE_INPLACE is set in dwFlags, this parameter is ignored.
      pcchUnEscaped
      [in/out] Number of characters in the buffer pointed to by pszEscaped. On entry, the value pcchEscaped points to is set to the size of the buffer. When the function returns, the value pcchEscaped points to is set to the number of characters written to that buffer, not counting the terminating NULL character. If an E_POINTER error code is returned, the buffer was too small, and the value pcchEscaped points to is set to the required number of characters in the buffer. If any other errors are returned, the value that pcchEscaped points to is undefined.
      dwFlags
      [in] Flags that control which characters are unescaped. It can be a combination of the following flags. Flag Description
      URL_DONT_UNESCAPE_EXTRA_INFO Don't convert the # or ? character, or any characters following them in the string.
      URL_UNESCAPE_INPLACE Use pszURL to return the converted string instead of pszUnEscaped.

      Return Values
      Returns an OLE success code if successful. If the URL_UNESCAPE_INPLACE flag is not set, the value pointed to by pcchUnEscaped will be set to the number of characters in the output buffer pointed to by pszEscaped. Returns E_POINTER if the URL_UNESCAPE_INPLACE flag is not set and the output buffer is too small. The pcchUnEscaped parameter will be set to the required buffer size. Otherwise, returns an OLE error value.

      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