[PLUG] Simple Directory Listing to HTML Script

Bear Giles bgiles at coyotesong.com
Wed Nov 20 20:53:27 UTC 2002


Randal L. Schwartz wrote:
> It doesn't percentify the HREF yet.  Mine did.
> A file named "please <blink me>" needs to look like:
> 
>   <a href="please%20<blink%20me>">please <blink me></a>

Huh???

Try

     <a href="please %3cblink me%3e">please <blink me></a>

or

     <a href="please%20%3cblink%20me%3e">please <blink me></a>

That is, use HTML encoding outside of the tags (<,> become <,>) 
and hex encoding within the tags (<,> become %3c,%3e)

But I don't see why you need to escape this anyway.  Well, maybe you do 
with some scripting languages that may be over-eager to interpret the 
space, < and > characters.  (I normally use C or java and this isn't an 
issue.)  Normally this encoding is only required for the characters used 
in GET commands (&, ?, =) and possibly characters with the high bit set.

Bear





More information about the PLUG mailing list