Implement ENCODE-URI-PATH-SEGMENT.
authorChris Hanson <org/chris-hanson/cph>
Tue, 8 Jun 2010 19:08:03 +0000 (12:08 -0700)
committerChris Hanson <org/chris-hanson/cph>
Tue, 8 Jun 2010 19:08:03 +0000 (12:08 -0700)
src/runtime/runtime.pkg
src/runtime/url.scm

index 63c5dbfe4311ef264e18a9d697b380f60d4796d0..bebac7a140902859b2447d552e2afc97cee6650c 100644 (file)
@@ -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
index 07750c4c014276569f9e52efa9ef7a84c7fc59b9..b24c62ed4b2af499e42f98383dfe31d8cf724ebe 100644 (file)
@@ -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))))
 \f
 ;;;; Escape codecs