realbasic-nug
[Top] [All Lists]

Re: Validate URL

To: REALbasic NUG <realbasic-nug at lists dot realsoftware dot com>
Subject: Re: Validate URL
From: Phil M <phil at mobleybros dot com>
Date: Thu, 31 Aug 2006 00:37:05 -0700
Delivered-to: listarchive at realsoftware dot com
Delivered-to: realbasic-nug at lists dot realsoftware dot com
References: <20060831064937 dot 2A383BD641 at xprdmxin dot myway dot com>
On Aug 30, 2006, at 11:49 PM, Steven Hedgepeth wrote:

Thanks Phil for this explaination. What resourses are available that elaborate on what you've written?

There is a lot of detail on the internet... very easy to Google it.

Why can't a valid URL, for example, have any spaces?

Because any non-alphanumeric character [0-9a-zA-Z] except "_" or "." are supposed to be escaped. Other characters which you see in the URL are either control characters, or they are unsafe to use for various reasons.

The following characters are URL control characters:

  Dollar        ("$")
  Ampersand     ("&")
  Plus          ("+")
  Comma         (",")
  Forward slash ("/")
  Colon         (":")
  Semi-colon    (";")
  Equals        ("=")
  Question mark ("?")
  'At' symbol   ("@")

To escape an non-alphanumeric character, you are suppose to use the "%" symbol and add the Hexadecimal value. For example, instead of seeing the space character in an URL, you would see it encoded with the sequence "%20".

So you can include spaces in URLs (as long as they are encoded). Now some browsers may accept a URL with spaces and other characters, but these are "features" (flaws) because they will usually cause more problems than they are worth.
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>


<Prev in Thread] Current Thread [Next in Thread>