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: craven
Subject: Re: [MIT-Scheme-devel] Why does URL:ENCODE-STRING not encode & and ; etc.?
Date: Thu, 03 May 2012 10:53:30 +0200
User-agent: Notmuch/0.11+77~gad6d0d5 (http://notmuchmail.org) Emacs/24.1.50.2 (i686-pc-linux-gnu)

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

Attachment: pgpgP8G9MimRj.pgp
Description: PGP signature


reply via email to

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