Solved

InternetCanonicalizeUrl question

Posted on 2003-11-06
5
883 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
[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
  • 3
  • 2
5 Comments
 
LVL 86

Accepted Solution

by:
jkr earned 250 total points
ID: 9696199
>>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
ID: 9696228
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
ID: 9696421
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
ID: 9696863
>>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
ID: 9710723
Thanks for the response jkr.  Although it wasnt what I wanted to hear, it is correct :)
0

Featured Post

Want Experts Exchange at your fingertips?

With Experts Exchange’s latest app release, you can now experience our most recent features, updates, and the same community interface while on-the-go. Download our latest app release at the Android or Apple stores today!

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…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
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 member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

628 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