473,434 Members | 1,820 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,434 software developers and data experts.

spaces, pipelins etc. in a url string

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
3 4765
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: gopal srinivasan | last post by:
Hi, I have a text like this - "This is a message containing tabs and white spaces" Now this text contains tabs and white spaces. I want remove the tabs and white...
9
by: Durgesh Sharma | last post by:
Hi All, Pleas help me .I am a starter as far as C Language is concerned . How can i Right Trim all the white spaces of a very long (2000 chars) Charecter string ( from the Right Side ) ? or how...
1
by: Anonieko Ramos | last post by:
> > > How to display multiple spaces in a dropdownlist webform1.aspx <asp:DropDownList id="DropDownList1" runat="server"></asp:DropDownList>
6
by: eight02645999 | last post by:
hi wish to ask a qns on strip i wish to strip all spaces in front of a line (in text file) f = open("textfile","rU") while (1): line = f.readline().strip() if line == '': break print line
135
by: Xah Lee | last post by:
Tabs versus Spaces in Source Code Xah Lee, 2006-05-13 In coding a computer program, there's often the choices of tabs or spaces for code indentation. There is a large amount of confusion about...
2
by: David | last post by:
Sent this to alt.php a couple of days back, but doesn't look like I'll get an answer, so trying here. I'm trying to convert a script to use friendly URLs, I've done this before, but my PHP...
15
by: DanielJohnson | last post by:
I am writing a program in which I am removing all the spaces from the string. I thought that I could do it two ways. One was parsing the string character by character and copying onto another...
3
by: bstjean | last post by:
Hi everyone, I am trying to find an efficient way to perform a special query. Let me explain what I want. Let's say we are looking for all description that match "this is the target". In...
8
by: drjay1627 | last post by:
hello, This is my 1st post here! *welcome drjay* Thanks! I look answering questions and getting answers to other! Now that we got that out of the way. I'm trying to read in a string and...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.