Solved

URLEncoder.encode() needed for C++

Posted on 2001-08-27
2
276 Views
Last Modified: 2007-12-19
Hi I am implementing a HTTP client in C++ and I need this function to "URL-encode" a given string. I know it's a standard function in Java, as well as in .NET platform.

Is there a (Visual) C++ implementation out there?
0
Comment
Question by:geekone
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
2 Comments
 
LVL 86

Expert Comment

by:jkr
ID: 6430229
'InternetCanonicalizeUrl()' should do what you want.
0
 
LVL 86

Accepted Solution

by:
jkr earned 100 total points
ID: 6430233
Ooops, forgot the link http://msdn.microsoft.com/library/default.asp?url=/workshop/networking/wininet/reference/functions/internetcanonicalizeurl.asp 

See also http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wceinet/htm/wininet_6.asp - quote:

The InternetCanonicalizeUrl function can be used to canonicalize URLs. InternetCanonicalizeUrl does not verify that the URL passed to it is canonicalized or that the URL it returns is valid.

The URL functions operate in a task-oriented manner. The content and format of the URL passed to the function is not verified. The calling application should track the use of these functions to ensure the data is in the intended format. For example, the InternetCanonicalizeUrl function would convert the character % into the escape sequence ?%25? when using no flags
0

Featured Post

[Webinar] How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Templates For Beginners Or How To Encourage The Compiler To Work For You Introduction This tutorial is targeted at the reader who is, perhaps, familiar with the basics of C++ but would prefer a little slower introduction to the more ad…
IntroductionThis article is the second in a three part article series on the Visual Studio 2008 Debugger.  It provides tips in setting and using breakpoints. If not familiar with this debugger, you can find a basic introduction in the EE article loc…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.

627 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question