Here's my example.
I am generating a URL that will be e-mailed out to a list of people periodically based on database content. The URL will be composed of a path that has spaces in it as well as the project name, which has spaces in it. The two parts which make up the URL come from a database and are read in at run-time.
I suspect if I was opening the URL directly it would not be an issue, but because the URL is in an e-mail the link doesn't work correctly without some sort of encoding to escape the spaces in the generated URL that is in the e-mail message.
That's why I thought encoding was the way to go.
Here's an example of what it looks like before encoding:
http://someserver/ProjectServer 101/Lists/Some Project Name/overview.aspx
Here's what I thought it should look like after encoding:
http://someserver/ProjectServer%20101/Lists/Some%20Project%20Name/overview.aspx I can do a straight substitution if I need to.
My question was if there was an existing "encode" that would handle the URL as I needed or if one of the Encoding classes was designed to do this already and I just needed to pick that instead of "UTF-8"
If there's not, that's fine, but I figured I'd ask here first.
Note: I just noticed after I posted that you can see the 'break' I'm talking about in my own URL included above. The one without the %20 is 'broken' in the URL.
[ June 13, 2005: Message edited by: Greg Ostravich ]