From: Taylor R. Campbell Date: Tue, 25 Jul 2006 18:21:44 +0000 (+0000) Subject: Change string encoding so that base64-encoded strings are properly X-Git-Tag: 20090517-FFI~981 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=38d0a73cae80cb375630b21d892aba6225862067;p=mit-scheme.git Change string encoding so that base64-encoded strings are properly wrapped in `base64' elements, and so that non-base64-encoded strings are not wrapped in superfluous `string' elements. --- diff --git a/v7/src/xml/xml-rpc.scm b/v7/src/xml/xml-rpc.scm index 729ade41d..cdd2a9d4e 100644 --- a/v7/src/xml/xml-rpc.scm +++ b/v7/src/xml/xml-rpc.scm @@ -1,6 +1,6 @@ #| -*-Scheme-*- -$Id: xml-rpc.scm,v 1.4 2006/01/30 20:20:45 cph Exp $ +$Id: xml-rpc.scm,v 1.5 2006/07/25 18:21:44 riastradh Exp $ Copyright 2003,2004,2005,2006 Massachusetts Institute of Technology @@ -294,12 +294,13 @@ USA. (define (encode-string string) (if (utf8-string-valid? string) - (rpc-elt:string string) - (call-with-output-string - (lambda (port) - (let ((context (encode-base64:initialize port #f))) - (encode-base64:update context string 0 (string-length string)) - (encode-base64:finalize context)))))) + string + (rpc-elt:base64 + (call-with-output-string + (lambda (port) + (let ((context (encode-base64:initialize port #f))) + (encode-base64:update context string 0 (string-length string)) + (encode-base64:finalize context))))))) (define *xml-rpc:encode-value-handler* #f)