]> code.delx.au - gnu-emacs/commitdiff
Properly encode/decode base64Binary data in SOAP
authorAndreas Schwab <schwab@linux-m68k.org>
Wed, 6 Jan 2016 19:50:02 +0000 (20:50 +0100)
committerAndreas Schwab <schwab@linux-m68k.org>
Wed, 6 Jan 2016 19:51:36 +0000 (20:51 +0100)
* lisp/net/soap-client.el (soap-encode-xs-basic-type): Encode
base64Binary value as utf-8.
(soap-decode-xs-basic-type): Decode base64Binary value as utf-8.

lisp/net/soap-client.el

index f8cdaa9bc567339b424cfccbd9aad29d83ec28e0..74024644966153a5b1e116e403a768c93baae49f 100644 (file)
@@ -538,7 +538,7 @@ This is a specialization of `soap-encode-value' for
                (base64Binary
                 (unless (stringp value)
                   (error "Not a string value for base64Binary"))
-                (base64-encode-string value))
+                (base64-encode-string (encode-coding-string value 'utf-8)))
 
                (otherwise
                 (error "Don't know how to encode %s for type %s"
@@ -682,7 +682,7 @@ This is a specialization of `soap-decode-type' for
                decimal byte float double duration)
          (string-to-number (car contents)))
         (boolean (string= (downcase (car contents)) "true"))
-        (base64Binary (base64-decode-string (car contents)))
+        (base64Binary (decode-coding-string (base64-decode-string (car contents)) 'utf-8))
         (anyType (soap-decode-any-type node))
         (Array (soap-decode-array node))))))