From c5efb86cddabe7a9354be15e2fce9ccd6dc907ea Mon Sep 17 00:00:00 2001 From: Chris Hanson Date: Tue, 8 Jun 2010 12:08:03 -0700 Subject: [PATCH] Implement ENCODE-URI-PATH-SEGMENT. --- src/runtime/runtime.pkg | 1 + src/runtime/url.scm | 6 ++++++ 2 files changed, 7 insertions(+) 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 -- 2.25.1