By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,760 Members | 955 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,760 IT Pros & Developers. It's quick & easy.

spaces, pipelins etc. in a url string

P: n/a
Hi,
When i save a url into a string :
string myURL = @"http://www.allmusic.com/cg/amg.dll?p=amg&sql=2surfer|rosa";

but when i d/l this page :

WebClient myClient = new WebClient();
StreamReader sr = new
StreamReader(myClient.OpenRead_searchAlbum),System .Text.Encoding.Unicode);
string result = sr.ReadToEnd();
string result = sr.ReadToEnd();

its seems that the pipeline "|" turnd into %c7 and the spaces turned
to %20

how can I fix that ?
Nov 13 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Hi,

Does this give you error?
It's the expected result, the query string is encoded according to the http
protocol. It should not give you error, though.

Hope this help,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"Moshe Foobar" <mi*******@newmail.net> wrote in message
news:a6**************************@posting.google.c om...
Hi,
When i save a url into a string :
string myURL = @"http://www.allmusic.com/cg/amg.dll?p=amg&sql=2surfer|rosa";
but when i d/l this page :

WebClient myClient = new WebClient();
StreamReader sr = new
StreamReader(myClient.OpenRead_searchAlbum),System .Text.Encoding.Unicode);
string result = sr.ReadToEnd();
string result = sr.ReadToEnd();

its seems that the pipeline "|" turnd into %c7 and the spaces turned
to %20

how can I fix that ?

Nov 13 '05 #2

P: n/a
The %c7 is the url-encoded version for the |
To convert it back have a look at .... urldecode

System.Web.HttpUtility.UrlDecode

Hope this helps,
Edwin Kusters

"Moshe Foobar" <mi*******@newmail.net> wrote in message
news:a6**************************@posting.google.c om...
Hi,
When i save a url into a string :
string myURL = @"http://www.allmusic.com/cg/amg.dll?p=amg&sql=2surfer|rosa";
but when i d/l this page :

WebClient myClient = new WebClient();
StreamReader sr = new
StreamReader(myClient.OpenRead_searchAlbum),System .Text.Encoding.Unicode);
string result = sr.ReadToEnd();
string result = sr.ReadToEnd();

its seems that the pipeline "|" turnd into %c7 and the spaces turned
to %20

how can I fix that ?

Nov 13 '05 #3

P: n/a
urldecode takes a string that has %20 and %c7 and transform them to
spaces and | but this is not my case.
The thing is that for some reason the string i send to the
StreamReader changes in some sort of way to a string with %20 and %c7.

in my code result is the url's html code.
if u look at the html code of :
http://www.allmusic.com/cg/amg.dll?p=amg&sql=2Surfer|Rosa
u will see the code im lookinf for
but i get the code of this :
http://www.allmusic.com/cg/amg.dll?p...2Surfer&c7Rosa
you can see the string im sending as a url and it contains | but
somewhere along the way the WebClient gets it with %c7 and not |
"Edwin Kusters" <NO***********@xs4all.nl> wrote in message news:<OI**************@TK2MSFTNGP11.phx.gbl>...
The %c7 is the url-encoded version for the |
To convert it back have a look at .... urldecode

System.Web.HttpUtility.UrlDecode

Hope this helps,
Edwin Kusters

"Moshe Foobar" <mi*******@newmail.net> wrote in message
news:a6**************************@posting.google.c om...
Hi,
When i save a url into a string :
string myURL =

@"http://www.allmusic.com/cg/amg.dll?p=amg&sql=2surfer|rosa";

but when i d/l this page :

WebClient myClient = new WebClient();
StreamReader sr = new
StreamReader(myClient.OpenRead_searchAlbum),System .Text.Encoding.Unicode);
string result = sr.ReadToEnd();
string result = sr.ReadToEnd();

its seems that the pipeline "|" turnd into %c7 and the spaces turned
to %20

how can I fix that ?

Nov 13 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.