473,386 Members | 1,741 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,386 software developers and data experts.

URI manipulation

Nak
Hi there,

When getting an URI sometimes it contains character combinations to
replace certain characters, such as "%20" for a space. Is there a function
in the .NET framework that converts these into their correct characters?
i.e.

"c:\my%20folder\my%20file.jpg"

to

"c:\my folder\my file.jpg"

Thanks in advance.

Nick.

--
/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
"No matter. Whatever the outcome, you are changed."

Fergus - September 5th 2003
/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
Nov 20 '05 #1
13 3508
Nak
I think decoding an URL might be the phrase that I am looking for. If I
need to write my own function to do this does anyone know where I can find
any reference to what the special characters are and what they should be
replaced for? Thanks again :-)

Nick.

--
/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
"No matter. Whatever the outcome, you are changed."

Fergus - September 5th 2003
/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
Nov 20 '05 #2
Cor
Nick,
This is from the document object model (mshtml)
URLUnencoded
Look for this on MSDN
As far as I understand you, does it exact what you ask, but are you using
mshtml
(Maybe you can do it with some JScript)
Cor
Nov 20 '05 #3
Hello,

"Nak" <a@a.com> schrieb:
But I get errors with that as when I use the ".location.
URLUnencoded" property I am getting "undefined"
returned. If I use URL I get the encoded URL but when
I use URLUnencoded it doesn't work. Is there no way of
decoding an URL within .NET?


Use 'document.URLUnencoded' instead.

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
http://www.mvps.org/dotnet
Nov 20 '05 #4
Hello,

"Jeff Molby" <JeffMolby@C_mc_st.n_t> schrieb:
I've never had to do it, so I'm not sure, but have you looked into the
System.URI and System.URIBuilder classes?


I have played around with both of the classes but I didn't find an easy way
to replace the encoded characters. If you find a solution, please let us
know.

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
http://www.mvps.org/dotnet
Nov 20 '05 #5
Nak
> I have played around with both of the classes but I didn't find an easy
way
to replace the encoded characters. If you find a solution, please let us
know.


All sorted now, I just have to keep the original passed URL because when it
is put into the URI object it encodes it again. Thanks for your help :-)

Nick.

--
/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
"No matter. Whatever the outcome, you are changed."

Fergus - September 5th 2003
/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
Nov 20 '05 #6
Nak
> Use 'document.URLUnencoded' instead.

Thanks Herfried :-)

Nick.

--
/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
"No matter. Whatever the outcome, you are changed."

Fergus - September 5th 2003
/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
Nov 20 '05 #7
Hello,

"Nak" <a@a.com> schrieb:
All sorted now, I just have to keep the original passed
URL because when it is put into the URI object it encodes
it again.


There is an overloaded constructor for the 'Uri' class that allows to
specify in the 2nd parameter that no encoding should be done. Nevertheless
I didn't find a way to remove the encoding.

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
http://www.mvps.org/dotnet
Nov 20 '05 #8
Hello,

"Nak" <a@a.com> schrieb:
Use 'document.URLUnencoded' instead.


Thanks Herfried :-)


I hope it helped. I searched for "URLUnencoded" in the MSDN libarary.
Maybe you can do that yourself in future.

;-)

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
http://www.mvps.org/dotnet
Nov 20 '05 #9
Nak
> I hope it helped. I searched for "URLUnencoded" in the MSDN libarary.
Maybe you can do that yourself in future.


Thanks Herfried. I would request that you cut the sarcasm, for your
information I had that web page on the screen at the time I recieved your
suggestion, I was trying many permiations of accessing the same variables
with no luck, your suggestion had been the only one that I hadn't tried.

Believe it or not, I do try other places before I try here, so don't be so
rude Herfried, you should know better!

Nick.

--
/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
"No matter. Whatever the outcome, you are changed."

Fergus - September 5th 2003
/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
Nov 20 '05 #10
Hello,

"Nak" <a@a.com> schrieb:
I hope it helped. I searched for "URLUnencoded" in the
MSDN libarary. Maybe you can do that yourself in future.


Thanks Herfried. I would request that you cut the sarcasm,
for your information I had that web page on the screen at
the time I recieved your suggestion, I was trying many permiations
of accessing the same variables with no luck, your suggestion had
been the only one that I hadn't tried.

Believe it or not, I do try other places before I try here, so don't be so
rude Herfried, you should know better!


Sorry, it was only a "joke".

;-)

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
http://www.mvps.org/dotnet
Nov 20 '05 #11
Nak
> Sorry, it was only a "joke".

Well hardy har! I was actually quite offended by that, but never mind. I'm
really appreciative of youe help Herfried, I know that you are a whole
wealth of knowledge and that you are miles ahead of myself, but you don't
need to rub it in with comments like that.

You spend hours and hours each day devoting your own time to people to help
them, and that is great, I spend hours and hours each day trying to program
my own applications, sometimes I miss something on a web site or have
problems understanding the jargon (you obviously don't have this problem),
but believe me, for every 1 question that I ask for myself in this newsgroup
I have already written many lines of code that I have found out myself! I
don't ask for help at every step believe me!, just the ones I am stuck on.

Nick.

--
/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
"No matter. Whatever the outcome, you are changed."

Fergus - September 5th 2003
/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
Nov 20 '05 #12
Hello,

"Nak" <a@a.com> schrieb;
Sorry, it was only a "joke".
Well hardy har! I was actually quite offended by that,
but never mind.


:-)
wealth of knowledge and that you are miles ahead of myself,
but you don't need to rub it in with comments like that.


Sorry...

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
http://www.mvps.org/dotnet
Nov 20 '05 #13
Hi Nick,

NET Framework does offer such a function to decode URIs. The special
characters are encoded with ASCII. If you¡¯re developing a web form
application, you can try to use java script to decode it.

If anything is unclear, please feel free to reply to the post.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."
--------------------
| From: "Nak" <a@a.com>
| Subject: URI manipulation
| Date: Mon, 15 Sep 2003 12:37:44 +0100
| Lines: 25
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| Message-ID: <eg**************@TK2MSFTNGP11.phx.gbl>
| Newsgroups: microsoft.public.dotnet.languages.vb
| NNTP-Posting-Host: dsl213-218-224-160.as15444.net 213.218.224.160
| Path:
cpmsftngxa07.phx.gbl!cpmsftngxa10.phx.gbl!cpmsftng xa06.phx.gbl!TK2MSFTNGP08.
phx.gbl!TK2MSFTNGP11.phx.gbl
| Xref: cpmsftngxa07.phx.gbl microsoft.public.dotnet.languages.vb:137295
| X-Tomcat-NG: microsoft.public.dotnet.languages.vb
|
| Hi there,
|
| When getting an URI sometimes it contains character combinations to
| replace certain characters, such as "%20" for a space. Is there a
function
| in the .NET framework that converts these into their correct characters?
| i.e.
|
| "c:\my%20folder\my%20file.jpg"
|
| to
|
| "c:\my folder\my file.jpg"
|
| Thanks in advance.
|
| Nick.
|
| --
|
/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
| "No matter. Whatever the outcome, you are changed."
|
| Fergus - September 5th 2003
|
/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
|
|
|

Nov 20 '05 #14

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Marcus | last post by:
I am having some problems with trying to perform calculations on time fields. Say I have a start time and an end time, 1:00:00 and 2:30:00 (on a 24 hour scale, not 12). I want to find the...
4
by: Rune Johansen | last post by:
Hi. I'm doing some image manipulation in an applet using the example code on this page: http://www.akop.org/art/pixels3.htm However, I really want an application rather than an applet, I just...
3
by: Sam | last post by:
Hello, in my coding work I'm going to using a lot of matix manipulation, just basic matrix addition, multiplication, Gaussian method solving for roots, least square... But I don't know if there's...
9
by: I. Kobrinsky | last post by:
I'm new here. I started a personal password-program, a trial that includes username, logincounter and password. So my intention is to hide pwd while tipping. So I'm thinking about two popular...
9
by: Job | last post by:
Hi, I would like to find out what ASP/ASP.net can do with image manipulation. Does ASP have built in functions (eg. after upload to server) to manipulate images, like rotate, scale, crop etc.?...
4
by: WaterWalk | last post by:
Hello, I'm currently learning string manipulation. I'm curious about what is the favored way for string manipulation in C, expecially when strings contain non-ASCII characters. For example, if...
8
by: shotokan99 | last post by:
i have this situation. i have a query string: http://www.myquerystring.com?x=xxxxx what this url does is it will return or start downloading a .png file. what i wanted to do is trap this png...
0
by: L'eau Prosper Research | last post by:
Press Release: L'eau Prosper Research (Website: http://www.leauprosper.com) releases new TradeStation 8 Add-on - L'eau Prosper Market Manipulation Profiling Tools Set. L'eau Prosper Market...
0
by: L'eau Prosper Research | last post by:
NEW TradeStation 8 Add-on - L'eau Prosper Market Manipulation Profiling Tools Set By L'eau Prosper Research Press Release: L'eau Prosper Research (Website: http://www.leauprosper.com) releases...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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,...

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.