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

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%20Chance.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 4622
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*******************@tostopspamhotmail.com> wrote in message
news:Z9********************@rogers.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%20Chance.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********@hotmail.com> wrote in message
news:uU*************@TK2MSFTNGP10.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*******************@tostopspamhotmail.com> wrote in
message
news:Z9********************@rogers.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%20Chance.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
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...
4
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...
2
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...
5
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...
0
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...
1
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...
3
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'"...
2
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...
3
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 {...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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...

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.