locked
Great Confusion Regarding Legal and Illegal URL Characters RRS feed

  • Question

  • I am researching what characters are illegal in URLs and what to do about them and I am finding little help from my Google searches.  There are two context questions which don't seem to be addressed.

    1) Some characters seem to be OK when invoking a browser but not OK when including the URL in an e-mail.

    2) Some hits are saying that, e.g., & and ? are illegal but I am pretty sure that that is wrong as ?x= and &y= are used to specify parameters, aren't they? 

    Is there one encoding which works when invoking a browser and which works for links in emails? 

    In my research I came across HttpUlility.URLEncode and URLPathEncode.  So I got all excited and tried them.  URLEncode did not seem to do anything!  URLPathEncode was at the other extreme, it translated, e.g., http:// to http%3a%2f%2f - yielding a result which is not so human friendly.  

    Any guidance?

    Thanks,  Bob

     

     

     

    • Moved by Helen Zhou Thursday, August 4, 2011 8:33 AM (From:Windows Forms General)
    Saturday, July 30, 2011 3:51 PM

Answers

  • I don't know where you looked, but this ain't the place.  All answers to questions regarding the world wide web can be found at the W3 Consortium.

    http://www.w3.org/Addressing/  

    The link just below is found on the above page.

    http://labs.apache.org/webarch/uri/rfc/rfc3986.html

     

    Rudy   =8^D


    Mark the best replies as answers. "Fooling computers since 1971."

    http://thesharpercoder.blogspot.com/

    • Proposed as answer by Kris444 Sunday, July 31, 2011 3:12 PM
    • Marked as answer by eBob.com Thursday, August 4, 2011 2:38 PM
    Saturday, July 30, 2011 6:00 PM
  • Thanks Rudedog2, but I had seen that web page and didn't find it very digestible.  Maybe if I were a lot smarter.  Also it didn't seem to address the problem of what can be pasted (as a link) into an email.  And, since it doesn't have a Windows orientation, doesn't mention Windows services (e.g. HttpUlility.URLEncode and URLPathEncode). 

    What I have done is to use HttpUtility.URLPathEncode but only for the parameter values.  For my purposes that seems to provide an acceptable result.

    Thanks for your assistance.

    Bob

    • Marked as answer by eBob.com Thursday, August 4, 2011 2:38 PM
    Thursday, August 4, 2011 2:38 PM

All replies

  • I don't know where you looked, but this ain't the place.  All answers to questions regarding the world wide web can be found at the W3 Consortium.

    http://www.w3.org/Addressing/  

    The link just below is found on the above page.

    http://labs.apache.org/webarch/uri/rfc/rfc3986.html

     

    Rudy   =8^D


    Mark the best replies as answers. "Fooling computers since 1971."

    http://thesharpercoder.blogspot.com/

    • Proposed as answer by Kris444 Sunday, July 31, 2011 3:12 PM
    • Marked as answer by eBob.com Thursday, August 4, 2011 2:38 PM
    Saturday, July 30, 2011 6:00 PM
  • Thanks Rudedog2, but I had seen that web page and didn't find it very digestible.  Maybe if I were a lot smarter.  Also it didn't seem to address the problem of what can be pasted (as a link) into an email.  And, since it doesn't have a Windows orientation, doesn't mention Windows services (e.g. HttpUlility.URLEncode and URLPathEncode). 

    What I have done is to use HttpUtility.URLPathEncode but only for the parameter values.  For my purposes that seems to provide an acceptable result.

    Thanks for your assistance.

    Bob

    • Marked as answer by eBob.com Thursday, August 4, 2011 2:38 PM
    Thursday, August 4, 2011 2:38 PM