Yes dZ you have right, if you have a Param containing reserved characters 
always must be PRE encoded (I can use Base64 or a Post method). But my 
problem is just an URL containing characters valid for standard Filenames.
...I was finding a function to do something like IE does in the address bar.




----- Original Message ----- 
From: "DZ-Jay" <[EMAIL PROTECTED]>
To: "ICS support mailing" <twsocket@elists.org>
Sent: Monday, February 13, 2006 7:09 AM
Subject: Re: [twsocket] Encode URL



On Feb 12, 2006, at 22:15, David A. G. wrote:

> The URL must be encoded because may have illegal characters:
>
> The user may enter an URL like:
> http://www.site.com/fol 1/fol 2/file 1.jpg?par=sdf|dfgó.jpg
>
> This URL must be encoded as:
> http://www.site.com/fol%201/fol%202/file%201.jpg?par=sdf%7Cdfg%F3.jpg

Yes, but you are assuming that non-encodable characters are part of the
URL; what if they were not?  What if the value of "par" contained an
ampersand symbol, a slash, an equal sign, or a question mark?  Since
you cannot tell which parts need to be encoded, you must use UrlEncode
individually on the parts that require it, and concatenate them with
the valid characters as in my example.

> This kind of codification must be "parse-sensitive", because an URL
> cannot
> be completely encoded without taking care of Protocol, Address, Port,
> Folders, File and Parameters (..and Authentication and Bookmark
> information).

Again, you are assuming that it is straight-forward.  The atoms for the
server part are predictable: protocol, FQDN, port, path, filename, but
anything after that is not, which is the reason why escaping is
necessary, because valid delimiters can be part of parameter names or
values.

dZ.
-- 
DZ-Jay [TeamICS]
http://www.overbyte.be/eng/overbyte/teamics.html

-- 
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 

-- 
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

Reply via email to