[racket] escaping binary data in url

From: Veer (diggerrrrr at gmail.com)
Date: Fri Aug 12 12:40:36 EDT 2011


Is there a way to encode/escape binary data in query part of url.

For example :

(require net/url)
(define (escape-bytes bites)
(define hash (bytes 255 255))
(define a-url (string->url "http://www.example.com/"))
(set-url-query! a-url (list (cons 'test (escape-bytes hash))))
(url->string a-url)

I get the output: "http://www.example.com/?test=%25ff%25ff"  instead
of "http://www.example.com/?test=%ff%ff"

Also I noticed that racket web server does not seem to handle above
query either.

I asked this question before also , but could not follow it up (sorry for that)


Posted on the users mailing list.