Solved

InternetCanonicalizeUrl question

Posted on 2003-11-06
5
837 Views
Last Modified: 2008-03-10
I'm trying to post the contents of a text file to a website.  The problem is that when I call InternetCanonicalizeUrl, it removes all the newline characters.  So if the text file looked like:

This is
the text

it gets encoded as

This%20isthe%20text

What is the correct way to post text to a website and keep the newline character intact?
0
Comment
Question by:lwinkenb
  • 3
  • 2
5 Comments
 
LVL 86

Accepted Solution

by:
jkr earned 250 total points
Comment Utility
>>when I call InternetCanonicalizeUrl, it removes all the newline characters

Newline characters are usually not supposed to be part of an URL - have you tried the 'ICU_NO_ENCODE' flag?
0
 
LVL 86

Expert Comment

by:jkr
Comment Utility
BTW, if that does not work, you might consider using an alternative approach like http://www.codeproject.com/string/urlencode.asp
0
 
LVL 5

Author Comment

by:lwinkenb
Comment Utility
I tried ICU_NO_ENCODE already, but it had the same problem.

I took a look at the link, but I'm not using MFC for this project.  I'm considering just replacing the newline characters with <br> and then encoding the string, but I was hoping there was some easier way to do it.
0
 
LVL 86

Expert Comment

by:jkr
Comment Utility
>>I'm not using MFC for this project

The interesting part of the encoding function does not use MFC :o)
0
 
LVL 5

Author Comment

by:lwinkenb
Comment Utility
Thanks for the response jkr.  Although it wasnt what I wanted to hear, it is correct :)
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

In days of old, returning something by value from a function in C++ was necessarily avoided because it would, invariably, involve one or even two copies of the object being created and potentially costly calls to a copy-constructor and destructor. A…
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 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 be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

762 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

9 Experts available now in Live!

Get 1:1 Help Now