From: Chris Hanson Date: Tue, 8 Jun 2010 19:08:03 +0000 (-0700) Subject: Implement ENCODE-URI-PATH-SEGMENT. X-Git-Tag: 20100708-Gtk~19 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=c5efb86cddabe7a9354be15e2fce9ccd6dc907ea;p=mit-scheme.git Implement ENCODE-URI-PATH-SEGMENT. --- diff --git a/src/runtime/runtime.pkg b/src/runtime/runtime.pkg index 63c5dbfe4..bebac7a14 100644 --- a/src/runtime/runtime.pkg +++ b/src/runtime/runtime.pkg @@ -5431,6 +5431,7 @@ USA. char-set:uri-segment char-set:uri-segment-nc char-set:uri-userinfo + encode-uri-path-segment error:not-partial-uri error:not-uri error:not-uri-authority diff --git a/src/runtime/url.scm b/src/runtime/url.scm index 07750c4c0..b24c62ed4 100644 --- a/src/runtime/url.scm +++ b/src/runtime/url.scm @@ -633,6 +633,12 @@ USA. (define (write-segment segment port) (write-encoded segment char-set:uri-segment port)) + +(define (encode-uri-path-segment segment) + (guarantee-string segment 'ENCODE-URI-PATH-SEGMENT) + (call-with-output-string + (lambda (port) + (write-segment segment port)))) ;;;; Escape codecs