473,809 Members | 2,617 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

spaces, pipelins etc. in a url string

Hi,
When i save a url into a string :
string myURL = @"http://www.allmusic.co m/cg/amg.dll?p=amg&s ql=2surfer|rosa ";

but when i d/l this page :

WebClient myClient = new WebClient();
StreamReader sr = new
StreamReader(my Client.OpenRead _searchAlbum),S ystem.Text.Enco ding.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 4775
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*******@newm ail.net> wrote in message
news:a6******** *************** ***@posting.goo gle.com...
Hi,
When i save a url into a string :
string myURL = @"http://www.allmusic.co m/cg/amg.dll?p=amg&s ql=2surfer|rosa ";
but when i d/l this page :

WebClient myClient = new WebClient();
StreamReader sr = new
StreamReader(my Client.OpenRead _searchAlbum),S ystem.Text.Enco ding.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.Http Utility.UrlDeco de

Hope this helps,
Edwin Kusters

"Moshe Foobar" <mi*******@newm ail.net> wrote in message
news:a6******** *************** ***@posting.goo gle.com...
Hi,
When i save a url into a string :
string myURL = @"http://www.allmusic.co m/cg/amg.dll?p=amg&s ql=2surfer|rosa ";
but when i d/l this page :

WebClient myClient = new WebClient();
StreamReader sr = new
StreamReader(my Client.OpenRead _searchAlbum),S ystem.Text.Enco ding.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.co m/cg/amg.dll?p=amg&s ql=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******* *******@TK2MSFT NGP11.phx.gbl>. ..
The %c7 is the url-encoded version for the |
To convert it back have a look at .... urldecode

System.Web.Http Utility.UrlDeco de

Hope this helps,
Edwin Kusters

"Moshe Foobar" <mi*******@newm ail.net> wrote in message
news:a6******** *************** ***@posting.goo gle.com...
Hi,
When i save a url into a string :
string myURL =

@"http://www.allmusic.co m/cg/amg.dll?p=amg&s ql=2surfer|rosa ";

but when i d/l this page :

WebClient myClient = new WebClient();
StreamReader sr = new
StreamReader(my Client.OpenRead _searchAlbum),S ystem.Text.Enco ding.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
15022
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 spaces(if it more than once between two words). Is there any function we have in C which will find out the tabs and white spaces and returns the text in the follwong way -
9
6285
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 can i make a fast Right Trim Function in c,using Binary search kind of fast algorithm ? Offcourse...I can use the classical approach too. like : Start from the right most charecter of the string to the left of the
1
4086
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
2690
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
7546
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 which is better. It has become what's known as “religious war” — a heated fight over trivia. In this essay, i like to explain what is the situation behind it, and which is proper.
2
6548
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 skills are quite basic so far, far from proficient at this. ..htaccess file- DirectoryIndex default.php index.asp index.html index.htm index.php
15
15629
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 output string. But this was trivial. The other option is to use pointers and shift all the characters after the space by one space to the left. I did this program using pointers and then using array too and I get segmentation fault. What is going...
3
4833
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 fact, I want to find records that match those 4 words in this sequence disregarding the number of spaces (I mean spaces, tabs, Cr, Lf, etc) between them.
8
4745
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 add the unique words in the string to a map. Eg:
0
9603
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10640
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10120
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9200
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development projectplanning, coding, testing, and deploymentwithout human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7662
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 presenter, Adolph Dupr who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6881
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5550
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5689
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4332
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.