Arnoud (
Sun, 13 Jul 1997 14:58:37 +0200

From: (Arnoud "Galactus" Engelfriet)
Subject: Re: CGI URLs in HREFs
Date: Sun, 13 Jul 1997 14:58:37 +0200
Message-ID: <>

In article <v0310285eafee2a020172@[]>,
Walter Ian Kaye <> wrote:
> So, I guess I'll have to update my '' library to check for
> semicolons instead of just assuming ampersands. Now to come up with
> a good algorithm. 

My CGI library simply splits at & _or_ ;. I think this is safe, because
the & and ; characters must always be encoded if they're used as the
literal characters in the URL (RFC 1738, section 2.2 "Reserved"). A
valid query string will therefore always contain _either_ ; or &
unescaped, and then that character is the separator.

Of course, if someone manually GETs  something like
then my script will see three arguments, yours will see two. But I'd
say the above query string is not valid, so we're both right. :-)

>   1. Count number of '='s in query string.
>   2. If more than one, determine whether '&' or ';' is used as field
>      separator:

Note that the above (invalid) query string has an equal number of ; and &
characters, so you don't know which one is correct.

E-mail: .................... PGP Key: 512/63B0E665
Maintainer of WDG's HTML reference: <>