InternetCanonicalizeUrl question

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?
LVL 5
lwinkenbAsked:
Who is Participating?
 
jkrConnect With a Mentor Commented:
>>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
 
jkrCommented:
BTW, if that does not work, you might consider using an alternative approach like http://www.codeproject.com/string/urlencode.asp
0
 
lwinkenbAuthor Commented:
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
 
jkrCommented:
>>I'm not using MFC for this project

The interesting part of the encoding function does not use MFC :o)
0
 
lwinkenbAuthor Commented:
Thanks for the response jkr.  Although it wasnt what I wanted to hear, it is correct :)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.