[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: emacs-25 b6b47af: Properly encode/decode base64Binary data in SOAP

From: Thomas Fitzsimmons
Subject: Re: emacs-25 b6b47af: Properly encode/decode base64Binary data in SOAP
Date: Wed, 09 Mar 2016 20:03:06 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux)

Hi Andreas,

Andreas Schwab <address@hidden> writes:

> branch: emacs-25
> commit b6b47af82f6c7d960388ec46dd8ab371c2e34de4
> Author: Andreas Schwab <address@hidden>
> Commit: Andreas Schwab <address@hidden>
>     Properly encode/decode base64Binary data in SOAP
>       * 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 |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> diff --git a/lisp/net/soap-client.el b/lisp/net/soap-client.el
> index f8cdaa9..7402464 100644
> --- a/lisp/net/soap-client.el
> +++ b/lisp/net/soap-client.el
> @@ -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))))))

I'm trying to merge Emacs master to the emacs-soap-client repository
(and back) to release soap-client 3.1.0.  This patch is causing some
test suite failures.  (Unfortunately the test suite is private because
we're not sure if we can redistribute the WSDL files therein.)  Here is
an example fragment that fails with your patch:


The test suite expects this to decode as:

Zolt\303\241n Krajcsovics [...]

but gets:

Zoltán Krajcsovics [...]

base64Binary is supposed to be for binary data; I don't think it's safe
to assume the content is a UTF-8-encoded string for encoding or
decoding, in general.

Do you have an example SOAP message that your patch fixes, and can the
surrounding code do the UTF-8 encoding/decoding instead of soap-client


reply via email to

[Prev in Thread] Current Thread [Next in Thread]