473,544 Members | 1,944 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

URLDecode

30 New Member
Recently i have engaged a company to track my articles across the net. at this point we have submitted them a few RSS feeds to load our content into their system for intial testing and what have you, nothing wrong with my RSS feeds, they are in standard .XML format UTF-8 encoding applied (yes i made i sure they were saved as such too.) Anyways they can not reach my content on the site because of "&"

now after some brief research i have come across URLDecode is the best way to handle this problem, OR URL Rewrite through the IIS.

So i guess my question is which is best, AND if URLDecode is the chosen method to handle this request what is the string that i have to pass to fix it.

Thanks in advance.
Sep 17 '07 #1
4 3956
jhardman
3,406 Recognized Expert Specialist
check out this article
Jared
Sep 17 '07 #2
googletired
30 New Member
check out this article
Jared
handy little article thank you, but i guess i know less about urldecode than i thought :)


Below i have pasted the code from my localvars.asp which handles all the pages for my site, Do i need to add the url decode string here? or is it something that has to be added to everypage?

(sample link of how my site proceeds, notice all the "&" in the RSS feed these are all read as "&")

http://test.testsite.com/default.asp...ontent=summary
&type=print&lan g=en&vol=XXXXXX &cat=X

http://test.testsite.com/default.asp...ent=getcontent
&type=print&lan g=en&vol=XXXXXX &cat=X&articleI D=XXXXXX&mode=v iew&id=


Expand|Select|Wrap|Line Numbers
  1. <% 
  2. DIM strContent, strFileID, strType, strLang, strVol, strCat, strArticleID, strKeyword,_ 
  3.         strThisRedirect, strDownload, strMode, strPageName, strBaseURL, strBaseQueryString, _
  4.         strhttp_host, strSection
  5.  
  6. strSection = request("section")
  7. strhttp_host = "http://" & request("http_host")
  8. strContent = lcase(cstr(Request.QueryString("content")))
  9. strFileID = lcase(cstr(Request.QueryString("id")))
  10. strType = lcase(cstr(Request.QueryString("type")))
  11. if strType = "" and strFileID <> "" Then strType = "digital"
  12. strLang = lcase(Request.QueryString("lang"))
  13. if strLang = "" Then strLang = "en"
  14. strVol = lcase(cstr(Request.QueryString("vol")))
  15. 'if strVol = "" Then
  16. '     If strType = "digital" then 
  17. '             strVol = "current"
  18. '     Else
  19. '             strVol = ""
  20. '     End If     
  21. 'End If
  22. strCat = lcase(Request.QueryString("cat"))
  23. strArticleID = Request.QueryString("articleid")
  24. If strFileID <> "" and strArticleID = "" Then strArticleID = strFileID 
  25. 'Bridge code to support the absense of the content field in the url
  26. if strContent = "" Then
  27.      IF strArticleID <> "" Then 
  28.              strContent = "getcontent"
  29.      else
  30.         strContent = "defcontent"
  31.      End if
  32. End if
  33. strKeyword = Request.Form("keyword")
  34. strThisRedirect = lcase(Request("QUERY_STRING"))
  35. strDownload = lcase(Request.QueryString("download"))
  36. strMode = lcase(Request.QueryString("mode"))
  37. strPageName = "/scripts/" & lcase(Request.QueryString("pagename")) & ".asp"
  38. if strPageName = "/scripts/.asp" THEN strPageName = "/scripts/default_content.asp"
  39. strBaseURL = "default.asp?pagename=media"
  40. strBaseQueryString = "&amp;type=" & strType & "&amp;lang=" & strLang
  41. %>
Hope you can help with this.
Sep 18 '07 #3
jhardman
3,406 Recognized Expert Specialist
Notice that your line 40 includes "&amp;". This is the problem (as far as I can tell). The thing is, when we include complex querystrings in URLs in links in a website, we are supposed to use "&amp;" rather than "&" (according to the w3c). This is supposed to protect against browsers misinterpreting some querystring as a complex character code. (imagine if someone had a querystring variable named "quot" and you can imagine how some browsers might interpret "&quot"). So there is an inherent conflict in how you need to write your pages for use with a standard browser and how they should be written for this service.

In my experience, I haven't seen a browser slip up on this problem in years so I would suggest erring in favor of the search service. I don't think any current browsers will interpret a character code if it doesn't include a final semi-colon, but I have seen this problem in the past and some fossils do use older browsers. Just to be sure, make sure none of your querystring variables are inadvertently HTML character code names, and then change all of your "&amp;"s to "&". This will not pass validation, it will definitely fail if you send it to w3c, but I would be very surprised if a browser ever got it wrong.

Jared
Sep 18 '07 #4
googletired
30 New Member
Yes i agree, but the problem lies within the company that crawls the net in search of the content, we submit an RSS feed to them and in the links possibly the text at times & is replaced with &amp; to make the feed vailid, but when they load these feeds into their webcrawler/sniffer they cannot reach the content because the website (I think) does not handle full url Decoding.

and on line 40 i guess it's the website parsing those & but i should say &amp; blah & srtblah

I am in process of trying a simple fix, i'll advise if it works.
Sep 18 '07 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

2
33455
by: Thomas Henz | last post by:
Hi again, can anyone tell me why it says that the object doesnt support this method? rs is a db query resultset. msg is a db field with urlencoded data in it. ------------ if not rs.eof then do while not rs.eof response.write(server.urldecode(rs("msg")))
0
1381
by: Yifan | last post by:
Hi I want to use UrlDecode() in C++. I have a Win32 Visual C++ (.NET) project #using <mscorlib.dll #using <System.dll #using <System.Web.dll using namespace System using namespace System::Web
1
1976
by: João Santa Bárbara | last post by:
hi all is there any replace for the System.Web.HttpUtility.UrlDecode to windows forms ... thks JSB
5
5716
by: Yifan | last post by:
Hi I want to use UrlDecode() in C++. I have a Visual C++ (.NET) Win32 project #using <mscorlib.dll #using <System.dll #using <System.Web.dll using namespace System using namespace System::Web
4
3411
by: John Hoge | last post by:
Hi, I need to UrlDecode a string in a simple console application, but I am having trouble accessing Server.UrlDecode, even though System.Web is included. The application pulls a text out of a referring URL string and (eventually) will run a simple report. Here is an excerpt of my code: using System;
6
11991
by: John Grandy | last post by:
Does Server.URLDecode() need to be applied to Request.QueryString(<key name>) ?
10
5855
by: Alex | last post by:
Hi, I UrlEncode a value that I put in my querystring. This value originally contains the character "è", which is UrlEncoded to "%E8". When I try to read the value from the querystring, I find out that the character now is "%u00c3%u00a8" in the querystring and thus does not urldecode to the original character, which is a problem. My site is...
1
2107
by: fjm67 | last post by:
I see Google edited my email address. Lets try this. captonline at yahoo dot com Can you guys help me out please? I need to implement urldecode into a php script and don't know how. Here is the string I need to include it into. $this->get_category_dropdown($db,"d",$show->CATEGORY,1);
20
3468
by: gert | last post by:
This based on a example i found at http://www.cs.tut.fi/~jkorpela/ forms/cgic.html #include <fcgi_stdio.h> #include <stdlib.h> int urldecode(char *src, char *last, char *dest){ int code; for (; src != last; src++, dest++){ if (*src == '+') *dest = ' ';
3
26251
by: gert | last post by:
Anybody can tell me what i need to import to make urlDecode() work in python2.5 please. import urllib urllib.urlDecode(post) #doesn't exist urllib.urldecode(post) #doesn't exist urldecode(post) #doesn't exist urlDecode(post) #doesn't exist
0
7362
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...
0
7704
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...
0
5904
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 project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5291
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...
0
3407
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...
0
3404
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1837
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
1
983
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
657
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...

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.