Solved

URLEncoder.encode() needed for C++

Posted on 2001-08-27
2
265 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
  • 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Many modern programming languages support the concept of a property -- a class member that combines characteristics of both a data member and a method.  These are sometimes called "smart fields" because you can add logic that is applied automaticall…
Container Orchestration platforms empower organizations to scale their apps at an exceptional rate. This is the reason numerous innovation-driven companies are moving apps to an appropriated datacenter wide platform that empowers them to scale at a …
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.

948 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now