Re: Spaces in urls

by "Harold A. Driscoll" <harold(at)driscoll.chi.il.us>

 Date:  Tue, 11 Apr 2000 12:42:50 -0500
 To:  Rosemary Norwood <liane(at)diarmadhi.mushhaven.net>
 Cc:  "J.P. Ambrutis" <jpa(at)aye.net>, HWG - Techniques <hwg-techniques(at)hwg.org>
 References:  aye
  todo: View Thread, Original
This one is actually quite straightforward.

A space is a valid character in the filesystem names of some systems, and
hence is quite valid. When used, however, it must be represented within a
URL (quoted) as %20.

A space character (" ") is by definition _not_ a valid character within a
URL, and hence can be considered a deliminator indicating the end of the URL.

When spaces are represented correctly within a URL (quoted as %20), all
browsers I know of will handle them correctly. 

When spaces are represented incorrectly within a URL (as a " " character)
most browsers will correctly interpret the space as not part of the URL.
The only badly-broken browser I'm aware of in this regard is a number of
versions of Microsoft's Internet Explorer.

Because of the complexity associated with use of spaces within file names
(this example associated with URLs being representative), many would
recommend against using them. Note the distinction, they are ~not
recommended~ as quite distinct from ~not allowed~.

Safe computing,  /Harold

At 11:25 11-04-00 , Rosemary Norwood wrote:
>Talk about a can of worms!
>
>Some of the UNIX and Windows people here can probably give you some
>information on this but, here's my 2 cents.
>
>No, this won't break browsers today, where it falls down is that this file
>naming scheme is not compatible on every unix or windows system, including
>looking back to the Windows 3.x set.
>
>I tend to discourage this in all my clients and in my workplace because,
>although most of the more recent Windows systems (95 and on, I think) will
>permit and encourage this kind of practice, not every piece of software
>for this platform can tolerate 20+ letters in a file name, nor (my latest
>pet peeve) the characters '.' ',' '-' etc.. I've just run across this
>lately with file names like this breaking a few of the editing and web
>page tools I use. Not fun to hunt these files down on a 20 000 file
>server.
>
>So the strict answer is: No, it won't break a browser, or most web
>servers. Is it best practice? Most definately not.
>
>Rosemary Norwood
>liane(at)mushhaven.net
>
>On Mon, 10 Apr 2000, J.P. Ambrutis wrote:
>
>> Had a client upload his existing site to our server tonight, went to check
>> on it just for fun, saw most of his file names had spaces in them.  It's a
>> new one on me, I've just NEVER seen this before.  Went to the browser to
>> watch it error out and it all looked fine. He's got names like " _clear
>> black tan water.html" and to my surprise it works... but I'm wondering
won't
>> this cause issues with SOMETHING down the road?  (By the way, Apache web
>> server running on Linux)
>> 
>> Thanks
>> 
> 
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Harold A. Driscoll                 mailto:Harold(at)Driscoll.Chi.IL.US
#include <std/disclaimer>                 http://Driscoll.Chi.IL.US

HWG hwg-techniques mailing list archives, maintained by Webmasters @ IWA

This page is part of a preserved archive of archives.hwg.org. The site is no longer active and its content is not maintained. For enquiries about this archive, write to archive(at)iwanet.org.