From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#38587: base64-decode-region breaks encoding Date: Sun, 15 Dec 2019 01:31:38 +0200 Organization: LINKOV.NET Message-ID: <87v9qieb6t.fsf@mail.linkov.net> References: <87blsdhzeb.fsf@mail.linkov.net> <87pngtndhd.fsf@gnus.org> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="17617"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) Cc: 38587@debbugs.gnu.org To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Dec 15 00:37:42 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 1igGyk-0004Se-HS for geb-bug-gnu-emacs@m.gmane.org; Sun, 15 Dec 2019 00:37:42 +0100 Original-Received: from localhost ([::1]:34674 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1igGyj-0000aZ-Bl for geb-bug-gnu-emacs@m.gmane.org; Sat, 14 Dec 2019 18:37:41 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:41877) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1igGy8-0008Kh-Hh for bug-gnu-emacs@gnu.org; Sat, 14 Dec 2019 18:37:05 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1igGy7-0002jX-6x for bug-gnu-emacs@gnu.org; Sat, 14 Dec 2019 18:37:04 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:58145) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1igGy7-0002j5-2A for bug-gnu-emacs@gnu.org; Sat, 14 Dec 2019 18:37:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1igGy7-0007dw-0N for bug-gnu-emacs@gnu.org; Sat, 14 Dec 2019 18:37:03 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 14 Dec 2019 23:37:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 38587 X-GNU-PR-Package: emacs Original-Received: via spool by 38587-submit@debbugs.gnu.org id=B38587.157636659829334 (code B ref 38587); Sat, 14 Dec 2019 23:37:02 +0000 Original-Received: (at 38587) by debbugs.gnu.org; 14 Dec 2019 23:36:38 +0000 Original-Received: from localhost ([127.0.0.1]:35883 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1igGxi-0007d4-2E for submit@debbugs.gnu.org; Sat, 14 Dec 2019 18:36:38 -0500 Original-Received: from dragonfly.birch.relay.mailchannels.net ([23.83.209.51]:48838) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1igGxg-0007cw-Hx for 38587@debbugs.gnu.org; Sat, 14 Dec 2019 18:36:37 -0500 X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Original-Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 7E0CE1A0C25; Sat, 14 Dec 2019 23:36:35 +0000 (UTC) Original-Received: from pdx1-sub0-mail-a34.g.dreamhost.com (100-96-14-23.trex.outbound.svc.cluster.local [100.96.14.23]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id 1655E1A0C6D; Sat, 14 Dec 2019 23:36:35 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Original-Received: from pdx1-sub0-mail-a34.g.dreamhost.com ([TEMPUNAVAIL]. [64.90.62.162]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384) by 0.0.0.0:2500 (trex/5.18.5); Sat, 14 Dec 2019 23:36:35 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|jurta@jurta.org X-MailChannels-Auth-Id: dreamhost X-Absorbed-Troubled: 64aaab4f34544db4_1576366595311_2001345377 X-MC-Loop-Signature: 1576366595311:3011476104 X-MC-Ingress-Time: 1576366595311 Original-Received: from pdx1-sub0-mail-a34.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a34.g.dreamhost.com (Postfix) with ESMTP id AEA837F5F7; Sat, 14 Dec 2019 15:36:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=linkov.net; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type:content-transfer-encoding; s=linkov.net; bh=GGwdnc bWwOkux9QoYZggMIZ3n54=; b=Xo9+7YJ3VV0bP9d9ltZUoUek1SP/fYtxxQMze8 +jn0fLMaXtxH3rpR7MB9YenOBa9foAXmETBkrUPiqyTgDbjAdp4YPW7r+158kLnr XKHCkkJ9Jc3GPf7gH4A/YtqfkoO0o8YAiEgroFzyws0ZkSBJWxZLuOe6kqoi16G4 TwyzY= Original-Received: from mail.jurta.org (m91-129-107-186.cust.tele2.ee [91.129.107.186]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: jurta@jurta.org) by pdx1-sub0-mail-a34.g.dreamhost.com (Postfix) with ESMTPSA id 94BDD7F5F5; Sat, 14 Dec 2019 15:36:28 -0800 (PST) X-DH-BACKEND: pdx1-sub0-mail-a34 In-Reply-To: <87pngtndhd.fsf@gnus.org> (Lars Ingebrigtsen's message of "Fri, 13 Dec 2019 03:52:46 +0100") X-VR-OUT-STATUS: OK X-VR-OUT-SCORE: -100 X-VR-OUT-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedufedrvddtvddgudduucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuggftfghnshhusghstghrihgsvgdpffftgfetoffjqffuvfenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephffvufhofhffjgfkfgggtgfgsehtkeertddtredunecuhfhrohhmpefluhhrihcunfhinhhkohhvuceojhhurhhisehlihhnkhhovhdrnhgvtheqnecukfhppeeluddruddvledruddtjedrudekieenucfrrghrrghmpehmohguvgepshhmthhppdhhvghlohepmhgrihhlrdhjuhhrthgrrdhorhhgpdhinhgvthepledurdduvdelrddutdejrddukeeipdhrvghtuhhrnhdqphgrthhhpefluhhrihcunfhinhhkohhvuceojhhurhhisehlihhnkhhovhdrnhgvtheqpdhmrghilhhfrhhomhepjhhurhhisehlihhnkhhovhdrnhgvthdpnhhrtghpthhtoheplhgrrhhsihesghhnuhhsrdhorhhgnecuvehluhhsthgvrhfuihiivgeptd 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:173363 Archived-At: >> 0. emacs -Q >> 1. insert a non-ASCII char, e.g. =E4 >> 2. select the region around the char >> 3. M-x base64-encode-region >> 4. select the region around the encoded text >> 5. M-x base64-decode-region >> >> results in a broken text. IOW, base64-encode-region and base64-decode= -region >> are not reversible, whereas their string counterparts are: >> >> (base64-decode-string (base64-encode-string "=E4")) >> =3D> "\344" > > Well, that's not really reversible, either. But when it's know that the source string was in UTF-8, shouldn't it be reversible? What is needed for that? Maybe an additional CODING arg for base64-decode-region? Or it would be enough to use the coding system of the output buffer?