From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Lars Ingebrigtsen Newsgroups: gmane.emacs.bugs Subject: bug#38587: base64-decode-region breaks encoding Date: Tue, 24 Dec 2019 16:37:15 +0100 Message-ID: <87r20tenv8.fsf@gnus.org> References: <87blsdhzeb.fsf@mail.linkov.net> <87pngtndhd.fsf@gnus.org> <87v9qieb6t.fsf@mail.linkov.net> <87eex66k7h.fsf@hase.home> <87zhft9rl4.fsf@mail.linkov.net> <835zig5kka.fsf@gnu.org> <87r214giaz.fsf@mail.linkov.net> <83k16v3pmn.fsf@gnu.org> <87o8w6zgz5.fsf@mail.linkov.net> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="148224"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: schwab@linux-m68k.org, 38587@debbugs.gnu.org To: Juri Linkov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Dec 24 16:38:12 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1ijmGB-000cOq-2i for geb-bug-gnu-emacs@m.gmane.org; Tue, 24 Dec 2019 16:38:11 +0100 Original-Received: from localhost ([::1]:39942 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ijmG9-00016y-De for geb-bug-gnu-emacs@m.gmane.org; Tue, 24 Dec 2019 10:38:09 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:33030) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ijmG3-00016W-O0 for bug-gnu-emacs@gnu.org; Tue, 24 Dec 2019 10:38:04 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ijmG2-0007cg-Kh for bug-gnu-emacs@gnu.org; Tue, 24 Dec 2019 10:38:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:46990) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ijmG2-0007cY-Hl for bug-gnu-emacs@gnu.org; Tue, 24 Dec 2019 10:38:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ijmG2-00080r-DH for bug-gnu-emacs@gnu.org; Tue, 24 Dec 2019 10:38:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 24 Dec 2019 15:38:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 38587 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: wontfix Original-Received: via spool by 38587-submit@debbugs.gnu.org id=B38587.157720184730759 (code B ref 38587); Tue, 24 Dec 2019 15:38:02 +0000 Original-Received: (at 38587) by debbugs.gnu.org; 24 Dec 2019 15:37:27 +0000 Original-Received: from localhost ([127.0.0.1]:52963 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ijmFT-000802-KO for submit@debbugs.gnu.org; Tue, 24 Dec 2019 10:37:27 -0500 Original-Received: from quimby.gnus.org ([95.216.78.240]:43728) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ijmFS-0007zq-IH for 38587@debbugs.gnu.org; Tue, 24 Dec 2019 10:37:27 -0500 Original-Received: from 77.16.52.139.tmi.telenormobil.no ([77.16.52.139] helo=sandy) by quimby.gnus.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ijmFI-0006vL-L4; Tue, 24 Dec 2019 16:37:19 +0100 In-Reply-To: <87o8w6zgz5.fsf@mail.linkov.net> (Juri Linkov's message of "Wed, 18 Dec 2019 01:10:06 +0200") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:173708 Archived-At: Juri Linkov writes: > Thanks, I'm using this advice. > > (advice-add 'base64-decode-region :after > (lambda (beg end &optional _base64url) > (decode-coding-region beg end buffer-file-coding-system)) > '((name . base64-decode-region-with-buffer-coding))) I think in many cases this will work fine, but you probably will have Emacs double-decode a lot of data, as the other code in Emacs will normally call decode-coding-region (if you want to end up with text), and you'll destroy the bits of your Emacs that decodes base64 data into images and the like. (If I read the advice correctly -- I'm not very familiar with advising functions.) > So I'm closing this. Not sure what could be added to documentation. Something equivalent to what the manual has to say about it would be nice. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no