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
Solved

InternetCanonicalizeUrl question

Posted on 2003-11-06
5
854 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
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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Written by John Humphreys C++ Threading and the POSIX Library This article will cover the basic information that you need to know in order to make use of the POSIX threading library available for C and C++ on UNIX and most Linux systems.   [s…
Introduction This article is the first in a series of articles about the C/C++ Visual Studio Express debugger.  It provides a quick start guide in using the debugger. Part 2 focuses on additional topics in breakpoints.  Lastly, Part 3 focuses on th…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
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.

828 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