[EMAIL PROTECTED] wrote:
>> ------- Original Message -------
>>> From : Francois
> PIETTE[mailto:[EMAIL PROTECTED]
>> Sent : 4/19/2007 2:46:48 PM
>> To : email@example.com
>> Cc :
>> Subject : RE: Re: [twsocket] httpcli v6 "bad request"
> >>> Agreed, so we need a FAST routine. URLEncode
>>> isn't smart enough to encode a complete URL, and it is
>>> slow (result := result + ..)
>> Next question is how smart should such a routine act?
>> Should it check for a valid URL in general or shall it
>> just check for valid encoding?
>> Should it auto-complete incomplete as well as
>> invalid URLs like IE? When you start thinking about
> this stuff
>> the routine in mind becomes slower and slower :(
>> Making URLEncode faster is probably enough for
>> the component. Checking valid
>> URL and autocomplete is another thing.
> I don't know if this is what Arno had in mind with
> the validation, but as I mentioned before, there is
> one more catch: what if the application encoded the
> URL to begin with?
> Then all percent symbols will be
> re-encoded and the URL mangled. For this reason you
> either need to unencode-reencode (slow!), or check
> for encoding and only encode if necessary.
RFC2396 sounds rather complicated:
" 2.4.2. When to Escape and Unescape
A URI is always in an "escaped" form, since escaping or unescaping a
completed URI might change its semantics. Normally, the only time
escape encodings can safely be made is when the URI is being created
from its component parts; each component may have its own set of
characters that are reserved, so only the mechanism responsible for
generating or interpreting that component can determine whether or
not escaping a character will change its semantics. Likewise, a URI
must be separated into its components before the escaped characters
within those components can be safely decoded. "
( http://www.faqs.org/rfcs/rfc2396.html )
We probably have to bind encoding to function ParseUrl() somehow.
Arno Garrels [TeamICS]
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be