mit-scheme-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [MIT-Scheme-devel] Why does URL:ENCODE-STRING not encode & and ; etc


From: Chris Hanson
Subject: Re: [MIT-Scheme-devel] Why does URL:ENCODE-STRING not encode & and ; etc.?
Date: Wed, 2 May 2012 22:44:44 -0700

You're confused because URL:ENCODE-STRING has nothing to do with "url
encoding", which the encoding used for
application/x-www-form-urlencoded (and which itself has nothing to do
with URIs).

As the code comment says, this is just a backwards compatibility
procedure for something that existed in the code base a couple of
years ago.  Don't use it.

The procedure you're looking for is ENCODE-WWW-FORM-URLENCODED .

On Wed, May 2, 2012 at 4:21 AM,  <address@hidden> wrote:
> Hello fellow Schemers!
>
> I may misunderstand things here, but isn't URL:ENCODE-STRING meant to
> propertly encode characters that are special to urls? Examples would be
> =, & and ; (which should all be encoded). However,
>
>> (url:encode-string "a=b&b=c;c=d")
>
> just echoes that string literally ("a=b&b=c;c=d") without any encoding.
> This is by design, as these characters are explicitly added to
> URL:CHAR-SET:UNESCAPED in runtime/url.scm.
>
> Is this implementation based on a different understanding of
> url-encoding? What am I missing here? I'm trying to use it to url-encode
> the name and value of cookies for HTTP, which necessarily means it must
> encode at least = and ; correctly.
>
> Thanks for any help!
>
> Peter
>
> _______________________________________________
> MIT-Scheme-devel mailing list
> address@hidden
> https://lists.gnu.org/mailman/listinfo/mit-scheme-devel



reply via email to

[Prev in Thread] Current Thread [Next in Thread]