From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Alex Harsanyi Newsgroups: gmane.emacs.devel Subject: Re: emacs-25 b6b47AF: Properly encode/decode base64Binary data in SOAP Date: Mon, 14 Mar 2016 21:18:38 +0800 Message-ID: References: <20160106200404.17375.71733@vcs.savannah.gnu.org> <87oaalxvi7.fsf@linux-m68k.org> <87k2l9xg19.fsf@linux-m68k.org> <87d1r1x84z.fsf@linux-m68k.org> <83lh5mfjsn.fsf@gnu.org> <83oaaidydx.fsf@gnu.org> <83io0qdtb0.fsf@gnu.org> <83egbdenx4.fsf@gnu.org> <87fuvtqv33.fsf@gmx.de> <87d1qx9qv7.fsf@gmx.de> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: ger.gmane.org 1457961542 25642 80.91.229.3 (14 Mar 2016 13:19:02 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 14 Mar 2016 13:19:02 +0000 (UTC) Cc: Andreas Schwab , Eli Zaretskii , Thomas Fitzsimmons , Stefan Monnier , emacs-devel@gnu.org To: Michael Albinus Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Mar 14 14:18:54 2016 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1afSOc-0006qb-Di for ged-emacs-devel@m.gmane.org; Mon, 14 Mar 2016 14:18:54 +0100 Original-Received: from localhost ([::1]:40939 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1afSOb-0007Yh-Pn for ged-emacs-devel@m.gmane.org; Mon, 14 Mar 2016 09:18:53 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:38052) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1afSON-0007YT-OA for emacs-devel@gnu.org; Mon, 14 Mar 2016 09:18:40 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1afSOM-0005zQ-RD for emacs-devel@gnu.org; Mon, 14 Mar 2016 09:18:39 -0400 Original-Received: from mail-io0-x235.google.com ([2607:f8b0:4001:c06::235]:34608) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1afSOM-0005zE-MG; Mon, 14 Mar 2016 09:18:38 -0400 Original-Received: by mail-io0-x235.google.com with SMTP id m184so221797110iof.1; Mon, 14 Mar 2016 06:18:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc; bh=GjAwRLIqKu2OwW1lYtjKF/FR+2iivZGKxvPPRRQvP5o=; b=igee1GKOyfDOFKpAkxd+YP1vPt+tw994nGJMElpkyenjFy6R1g8AZFfsf+1hUMHOAm 8RgrzbllXt+OpT0Ny7vbf+kiZt7KsiJMaO/NrV1j/1ZupaMeRV2SE1KslBfmY4OkfHkl YLa5xDgvXo4JGhzh9sqXMNtwks3IiJZ88CSBNSoc2rD2zSaMh/qgS+UQg8QXwTeF4kn9 2e9oNSvMx9tw/nAH4UmmtJVH32xboM0kGJKo3srrWa23jV5Nxe9iBUdyJYScNaogzhv8 0gWkZbTNqpn4Km/04RLlS0R5yJjg0/ee1+e/ZOOzZl/FrVurL6rDABCghH2d35N84nHd oDgA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc; bh=GjAwRLIqKu2OwW1lYtjKF/FR+2iivZGKxvPPRRQvP5o=; b=knv1xGRJFAW21oM6YH6E8M5I451mP6i000EYWkbEqcMH25yBvybNNl1V0DlFTdx6Qv JOomHUlHyDKB7T0Sm4e2n8GAAixGvtHCQxJ0KKRbdcgkaPaHiYvtgia5+CF1917EY7mx F+gUNnAMQsFvs3xrRgHYX3kfnTxSpKOUw7mQMk1KDHFr5pgPh1c4H7BPLvk1/2T1sldZ uV2lNYuROquAMTUvy5QnQxWewRhfzePAyeXfn5ctTWaYUdwXRYfcGzRNC/JhQz56kFZa 5CW72hKmFgOscc9xsLmaEFL6WDKNN+iwolaYiCHez6tY6pSOEjDGudlRtBDbOeDjoG5E 7XYw== X-Gm-Message-State: AD7BkJKO/H5bVgV1/W69qmEI56XsWAIJbYvGt8xuaTsu7ez6W1xDm3eR/ZTOtlaZd0SpqOeuGx26KC3Uv7pb0Q== X-Received: by 10.107.155.206 with SMTP id d197mr22410624ioe.135.1457961518151; Mon, 14 Mar 2016 06:18:38 -0700 (PDT) Original-Received: by 10.107.57.4 with HTTP; Mon, 14 Mar 2016 06:18:38 -0700 (PDT) In-Reply-To: <87d1qx9qv7.fsf@gmx.de> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2607:f8b0:4001:c06::235 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:201693 Archived-At: 2016-03-14 20:38 GMT+08:00 Michael Albinus : > Alex Harsanyi writes: > >> I think the problem here is that the debbugs server encodes utf8 >> values as base64, even though the message envelope is utf8 XML and >> could handle them as normal strings. debbugs.el does not want to >> know about this, so expects strings to be strings. soap-client.el is >> caught in the middle. > > Well, if debbugs.el would get an indication from soap-client.el, whether > a string was encoded as xsd:string or xsd:base64Binary, it could decode > the latter values itself. Less convenient, but so what. We were discussing with Thomas to have soap-client.el return the base64 string "as is" and let the caller decode and process it. Unfortunately, there is no base64-string-p function and this value would look like a (multibyte) string. Perhaps we could return (cons 'base64 value), or a more appropriate type for a "array of bytes" concept. I'm open to suggestions. > >> I would also like to reiterate that base64 encoding can be used for >> other things, such as images, and it would not be appropriate to >> decode those as utf8 (not to mention that such a decoding might fail). > > Is there a way to tell soap-client.el, what to do with base64 encoded values? > Something like a user-defined function, or alike? This would not work in the general case except when all base64 encoded values are the same underlying type (like utf8). Although, given that debbugs.el is the only soap-client client that is affected by this, we can add a simple "soap-base64-handler" function to do what needs doing, and we can always extend that interface later as more use cases emerge. Best Regards, Alex.