[fpc-pascal] Re: URIParser

Ludo Brands ludo.brands at free.fr
Wed May 18 17:20:44 CEST 2011

The differences I mentioned are just the tip of the iceberg. Another
example: the RFC definition for URI permits for every scheme to define their
own character escape sequence for special and non ascii-characters. Guess
what: sip allows reserved characters in the user field :
sip:+1-212-555-1212:1234 at gateway.com;user=phone. Another one?
sip:alice;day=tuesday at atlanta.com is allowed and means
user="alice;day=tuesday". (both from
An "extra" field is not going to be enough to get around these differences
I'm afraid.

-----Message d'origine-----
De : fpc-pascal-bounces at lists.freepascal.org
[mailto:fpc-pascal-bounces at lists.freepascal.org] De la part de ik
Envoyé : mercredi 18 mai 2011 17:03
À : FPC-Pascal users discussions
Objet : Re: RE : [fpc-pascal] Re: URIParser

On Wed, May 18, 2011 at 17:56, <michael.vancanneyt at wisa.be> wrote:

On Wed, 18 May 2011, Ludo Brands wrote:

Problem is that the RFC definition for the URI doesn't specify the
individual protocol scheme. So every protocol can specify it's own stuff.

Take the general sip URI:
sip:user:password at host:port;uri-parameters?headers. User can be a telephone
number with folowing definition: global-phone-number   = "+"
base-phone-number [isdn-subaddress]
                      [post-dial] *(area-specifier /
                      service-provider / future-extension)
local-phone-number    = 1*(phonedigit / dtmf-digit /
                      pause-character) [isdn-subaddress]
                      [post-dial] area-specifier
                      *(area-specifier / service-provider /
This definitely will require custom processing.
Also both uri-parameters and headers are name=value pairs. The first are
separated by ";" and the second by "&"...

I'm afraid a universal URI decoder isn't possible.

Great. In that case I just declare that URIParser will only work for ftp and
protocols :-)

I think it is possible. You can also add another field to the record of
"Extra data" and allow others to parse it.
the headers are like the HTTP URI (even the encoding of it is the same), and
the params are like the HTTP Post more or less but divided by a semicolon.
But I can work with parsing it myself imho, because that part is either
starting with question mark or by semicolon.



fpc-pascal maillist  -  fpc-pascal at lists.freepascal.org

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20110518/347a6626/attachment.html>

More information about the fpc-pascal mailing list