473,836 Members | 1,606 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Problem with Web.HttpUtility .UrlDecode

I have a file name which will not decode correctly with the
Web.HttpUtility .UrlDecode routine.

The original file name is :
"G:/MyMusic/iTunes/iTunes%20Music/38%20Special/Rock%20&%20Roll %20Strategy/01%20Second%20C hance.mp3/"

The file name after the routine is:
"G:/MyMusic/iTunes/iTunes Music/38 Special/Rock & Roll Strategy/01
Second Chance.mp3/"

Note the "38 Special/Rock & Roll Strategy" which should be translated as
"38 Special/Rock & Roll Strategy"

Any ideas?

Lloyd Sheen
Nov 19 '05 #1
2 4684
Hi Lloyd,

URLEncoding doesn't usually use entities. An Ampersand should be represented
as %38... You might also try & although I'm sure the problem is that
UrlDecode doesn't do the HtmlDecoding.

To fix this issue you can HtmlDecode after you're done UrlDecoding.

+++ Rick ---

--

Rick Strahl
West Wind Technologies
http://www.west-wind.com/
http://www.west-wind.com/weblog/
http://www.west-wind.com/wwThreads/
----------------------------------
Making waves on the Web
"Lloyd Sheen" <sq************ *******@tostops pamhotmail.com> wrote in message
news:Z9******** ************@ro gers.com...
I have a file name which will not decode correctly with the
Web.HttpUtility .UrlDecode routine.

The original file name is :
"G:/MyMusic/iTunes/iTunes%20Music/38%20Special/Rock%20&%20Roll %20Strateg
y/01%20Second%20C hance.mp3/"
The file name after the routine is:
"G:/MyMusic/iTunes/iTunes Music/38 Special/Rock & Roll Strategy/01
Second Chance.mp3/"

Note the "38 Special/Rock & Roll Strategy" which should be translated as "38 Special/Rock & Roll Strategy"

Any ideas?

Lloyd Sheen

Nov 19 '05 #2
Problem is that I don't do the encoding. This is done by ITunes. All file
names which have an "&" have the same problem. I have had to put in a
special set of code just for this. Oh well I guess Apple remains a domain
unto themselves.

Lloyd Sheen

"Rick Strahl [MVP]" <ri********@hot mail.com> wrote in message
news:uU******** *****@TK2MSFTNG P10.phx.gbl...
Hi Lloyd,

URLEncoding doesn't usually use entities. An Ampersand should be
represented
as %38... You might also try &amp; although I'm sure the problem is that
UrlDecode doesn't do the HtmlDecoding.

To fix this issue you can HtmlDecode after you're done UrlDecoding.

+++ Rick ---

--

Rick Strahl
West Wind Technologies
http://www.west-wind.com/
http://www.west-wind.com/weblog/
http://www.west-wind.com/wwThreads/
----------------------------------
Making waves on the Web
"Lloyd Sheen" <sq************ *******@tostops pamhotmail.com> wrote in
message
news:Z9******** ************@ro gers.com...
I have a file name which will not decode correctly with the
Web.HttpUtility .UrlDecode routine.

The original file name is :

"G:/MyMusic/iTunes/iTunes%20Music/38%20Special/Rock%20&%20Roll %20Strateg
y/01%20Second%20C hance.mp3/"

The file name after the routine is:
"G:/MyMusic/iTunes/iTunes Music/38 Special/Rock & Roll Strategy/01
Second Chance.mp3/"

Note the "38 Special/Rock & Roll Strategy" which should be translated

as
"38 Special/Rock & Roll Strategy"

Any ideas?

Lloyd Sheen


Nov 19 '05 #3

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

Similar topics

0
1305
by: Tejaswi | last post by:
Hello! I have a J# socket client that does an HTTP Post. Code pasted below. This client works fine on my XP and Win 2003 boxes, but on my Win 2000 Server box, the socket just hangs when it tries to read. No exception nothing just hangs. Any suggestion? public static String httpPost(String url, String payload, String ContentType)throws Exception, System.Exception { WebResponse result = null;
4
1552
by: quest | last post by:
<?xml version="1.0" encoding="UTF-8"?> <VV version="2"> </VV> I have a simple xml as above. I posted it (using HTTP post command) from my Win32 app ("text/xml; utf-8" specified) to http handler written in C#. To my surprise, I am gettting something like this from my http handler : "%3C%3Fxml+version%3D%221.0%22+encoding%3D%22UTF-8%22%3F%3E%3" which is supposed to be :
2
3817
by: Marc Cardinal | last post by:
I have a need to encode and decode url content. I'm currently using the UrlDecode and UrlEncode methods from the HttpUtility class. However the code must be able to run under the .Net Internet Permission trust level. Since there is a System.Web.AspNetHostingPermission link demand on the HttpUtility class, I cannot use the decode and encode methods. Anyone have a workaround for this?
5
1827
by: Danny | last post by:
I am working on a project in which a number of client applications will be posting xml documents as a byte array to an ASP.NET page on our web server. I am trying to simulate the process and run into problems. Sending code: ASCIIEncoding encoding = new ASCIIEncoding(); string lcUrl = "http://localhost/test/receive.aspx"; HttpWebRequest loHttp =
0
1345
by: Danny | last post by:
I am working on a project in which a number of client applications will be posting xml documents as a byte array to an ASP.NET page on our web server. I am trying to simulate the process and run into problems. Sending code: ASCIIEncoding encoding = new ASCIIEncoding(); string lcUrl = "http://localhost/test/receive.aspx"; HttpWebRequest loHttp =
1
3031
by: lookaround | last post by:
Hi, I have a problem with UrlEncoding/UrlDecoding. I have two chars (東京); the HTTPUtility.UrlEncode writes in the html the text: %e6%9d%b1%e4%ba%ac The Request.Querystring.ToString() of the called page returns: %u00e6%u009d%u00b1%u00e4%u00ba%u00ac
3
2619
by: Bob | last post by:
Hi, i want to pass the date/time from one page to another page like this: firts page: --------- <asp:HyperLink ID="HyperLink1" NavigateUrl="mypage.aspx?dat= & 'date.now'" runat="server">lijst</asp:HyperLink> the code-behind of mypage.aspx
2
5179
by: SpecialKay | last post by:
So im having a problem decrypting a query string using Tshak. encryption code: private SecureQueryString objStrT = new SecureQueryString(); StringBuilder retURL = new StringBuilder(255); objStrT.Add("TOFUPaymentOrderID", order.OrderId);
3
1494
by: sewen | last post by:
Dear all, I got a problem when i tried to access cookie in my project. There are 2 pages in the project:a.aspx and b.aspx. In a.aspx,i put the fololowing scripts: function SetCookie(name,value { var Days = 30; var exp = new Date(); exp.setTime(exp.getTime() + 24*60*60*1000); document.cookie = name + "="+ escape (value) + ";expires=" +
0
9825
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, well explore What is ONU, What Is Router, ONU & Routers main usage, and What is the difference between ONU and Router. Lets take a closer look ! Part I. Meaning of...
0
9671
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
10852
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...
1
10596
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9382
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
7793
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
5651
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...
1
4459
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
3
3116
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.