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: Fri, 4 May 2012 01:09:59 -0700

Actually the correct fix is

  (let ((input (open-input-octets octets start end)))

which I've committed to HEAD.

On Thu, May 3, 2012 at 1:53 AM,  <address@hidden> wrote:
> On Wed, 2 May 2012 22:44:44 -0700, Chris Hanson <address@hidden> wrote:
>> 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.
>
> Thanks for that explanation, that clears things up :)
>
>> The procedure you're looking for is ENCODE-WWW-FORM-URLENCODED .
>
> That looks like exactly what I wanted! Thanks for the pointer! I've
> tried it in conjunction with DECODE-WWW-FORM-URLENCODED, and found a
> bug (in html-form-codec.scm):
>
> (define (decode-www-form-urlencoded octets start end)
>  (call-with-input-octets octets start end
>  ...))
>
> => should probably use SUBSTRING=>
>
> (define (decode-www-form-urlencoded octets start end)
>  (call-with-input-octets (substring octets start end)
>  ...))
>
> as CALL-WITH-INPUT-OCTETS only takes two parameters, not four.
>
> Thanks for the help!
>
> Peter



reply via email to

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