[Seaside] is there url encoding in Seaside or Squeak?

Stuart Herring stuartrh at gmail.com
Wed Oct 3 10:30:30 UTC 2007


On 9/30/07, Merik Voswinkel <merik at mac.com> wrote:
> My mistake because I was looking for something to encode the whole
> url, not one character.
> After two hours I have found what I was looking for: String>>>
> encodeForHTTP encodes the whole string:
>
> xmlUrl := xmlUrl encodeForHTTP.
>
> But it does not encode all (just like Seaside), it does not encode
> the '_' and the '.' as you can see from this result:
>
> xmlPath%3Dhttp%3A%2F%2Fwww.macmerik.nl%3A9090%2Fseaside%2Ftests%
> 2Ffacade%3F14%26_k%3DzllSchmY%26_s%3DqzSqkxyQfMWoNLdV
>
> So I will rewrite it to encode those characters as well, like the
> tool at http://www.dommermuth-1.com/protosite/experiments/encode/
> index.html .
> This tool is written in Flash and does encode the '_' and '.'  also.
> I need the conversion Flash uses because it is for passing url's with
> FlashVars to Flash.
>
> The question that remains is why some characters are not encoded and
> others are.
Why would you encode '_' or '.'?  They have no special meaning in a
URL or in HTTP and they both fall within the 7 bit ASCII character set
as standard printable characters.
Encoding them would produce a needlessly long URL and waste CPU cycles
at both ends.

>From the RFC you quoted above:
   Thus, only alphanumerics, the special characters "$-_.+!*'(),", and
   reserved characters used for their reserved purposes may be used
   unencoded within a URL.

'_' and '.' are explicitly mentioned as not needing to be encoded

>From your examples it's apparent that you don't want _every_ character
encoded as you're not expecting the standard alpha-numeric characters
to be encoded, so why underscore and full-stop?


More information about the Seaside mailing list