On Wed, 2 May 2012 22:44:44 -0700, Chris Hanson <c...@chris-hanson.org> 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: pgp7qp6QGs0wn.pgp
Description: PGP signature

_______________________________________________
MIT-Scheme-devel mailing list
MIT-Scheme-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/mit-scheme-devel

Reply via email to