From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Lars Ingebrigtsen Newsgroups: gmane.emacs.bugs Subject: bug#27270: display-raw-bytes-as-hex generates ambiguous output for Emacs strings Date: Sun, 24 Apr 2022 13:24:53 +0200 Message-ID: <87sfq2d8qi.fsf@gnus.org> References: <29d6844f-2f6f-11c1-7877-a9d169e613f8@cs.ucla.edu> <83tw3s8jhr.fsf@gnu.org> <1c05b888-0c4a-05c8-248a-6e550637fff4@cs.ucla.edu> <8737bbxp6a.fsf@users.sourceforge.net> <2d5a8cd8-0884-bc1e-4298-a84dca61acbf@cs.ucla.edu> <831squ8no8.fsf@gnu.org> <93d9c575-4eb2-ea9e-d998-a8f3cff33a1e@cs.ucla.edu> <83y3t271ar.fsf@gnu.org> <83shja6yoq.fsf@gnu.org> <83r2yt7lad.fsf@gnu.org> <2202b54b-606f-0a10-abf7-5cb1a9164897@cs.ucla.edu> <87k0bfsxvk.fsf@gnus.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="893"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: v.schneidermann@gmail.com, 27270@debbugs.gnu.org, npostavs@users.sourceforge.net To: Paul Eggert Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Apr 24 13:26:12 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1niaNY-000Aca-PT for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 24 Apr 2022 13:26:12 +0200 Original-Received: from localhost ([::1]:57994 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1niaNX-0000He-9z for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 24 Apr 2022 07:26:11 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:40276) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1niaNO-0000CX-MT for bug-gnu-emacs@gnu.org; Sun, 24 Apr 2022 07:26:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:35583) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1niaNO-0003I3-Di for bug-gnu-emacs@gnu.org; Sun, 24 Apr 2022 07:26:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1niaNO-000679-3y for bug-gnu-emacs@gnu.org; Sun, 24 Apr 2022 07:26:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 24 Apr 2022 11:26:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 27270 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: moreinfo Original-Received: via spool by 27270-submit@debbugs.gnu.org id=B27270.165079950723420 (code B ref 27270); Sun, 24 Apr 2022 11:26:02 +0000 Original-Received: (at 27270) by debbugs.gnu.org; 24 Apr 2022 11:25:07 +0000 Original-Received: from localhost ([127.0.0.1]:57710 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1niaMU-00065f-UR for submit@debbugs.gnu.org; Sun, 24 Apr 2022 07:25:07 -0400 Original-Received: from quimby.gnus.org ([95.216.78.240]:39158) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1niaMS-000656-MK for 27270@debbugs.gnu.org; Sun, 24 Apr 2022 07:25:05 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=OHTSX4fdaAQSIRhbmrnwemWXzyZICmpV3CpC2RwmouU=; b=NsdGpdUaAykiE1jZlGs7Rb3m0D jL1175/pRDh4mBEgTFJC1cyYlNn2OOKF/oHI8vySRGdvwWqv5dPquRB8AbW8NnRzzlqPADE3P5frv fWHOcNomxvbpKUtwG3IccfFABysNSui7Cwfwk263nWeCa0/mS7VaVQOJ3aWQ+1XKUE74=; Original-Received: from [84.212.220.105] (helo=xo) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1niaMJ-000557-4c; Sun, 24 Apr 2022 13:24:57 +0200 Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAABGdBTUEAALGPC/xhBQAAACBj SFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAElBMVEX9HqDhVq/m3C6r ytyWfar////NQ8kVAAAAAWJLR0QF+G/pxwAAAAd0SU1FB+YEGAsSJVNBwPoAAAGpSURBVDjLlVQB buQwCIRsH4A3fUBN/YBNfQ9ovfz/TWWwY6c96aSzlAgzHgaICRER079XSkm6MT14Md4BsApLHMRu E1ZfcGwqt8dJYrqrnogO1QMxhr8je/glBX0uANBgWKRarKUE4G1E3zReZi27cbegUB4pmpkCSI4H pRdE2JpmeoXRKVixtdY03K0n1o8jEtxuaJnybjuAx/5os7SdsV6tNLgRSt8fnv8JwGPF1fW91oqa eqwXnC+gpd2Bh3dtAFD1uj88mVuth1ebB8PTKs/68O9AiHUFmj2rbOUTlKn+4vm4ip8sX8S1Cg2A I1k9/gZc3LU9m2JESGuGQjeeDthPgKOD2LdfgIvn3fN34PMKeBffKAAzuYpHQch/a0VuVwAFhYOL M1eBaCfyx/Xia68CQJMc2aG9zRukoT6WzLZTWDz8B87JvHNKJ0VoW/eHcYZPwn1qg5wjo8hs3d6I FSMky56x8g+TZcY6+d3ajxUrODwmJ8SCtwYKhLzHcGJEefpzTGdfch3C9T+QPry8/DyAtI0/heYw dub4BLLTbZUUBD5Og/5jfQPXSF28tdPdbgAAACV0RVh0ZGF0ZTpjcmVhdGUAMjAyMi0wNC0yNFQx MToxODozNyswMDowMBJB4HoAAAAldEVYdGRhdGU6bW9kaWZ5ADIwMjItMDQtMjRUMTE6MTg6Mzcr MDA6MDBjHFjGAAAAAElFTkSuQmCC X-Now-Playing: Amon =?UTF-8?Q?D=C3=BCl?= II's _Deutsche Elektronische Music 4 (1)_: "Wolf City" In-Reply-To: (Paul Eggert's message of "Sun, 24 Apr 2022 00:10:44 -0700") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:230545 Archived-At: Paul Eggert writes: > Not surprising, since most people don't set > display-raw-bytes-as-hex. But that doesn't mean it's not a > problem. Quoting bugs can be issues even if they're unlikely to occur > at random. (Think SQL injection. :-) I don't think we're talking quite the same magnitude -- this is a problem if you're cutting strings from a -nw Emacs and pasting into a different Emacs and then using the Lisp reader to read it back. And then there's a raw byte in the string. The likelihood of anybody actually encountering this issue is ... small. >> I tend to think that introducing a new syntax just to fix it >> isn't worth it. > > That's fine, so let's fix the problem as originally suggested. That > is, display the string returned by (format "%c%c" #x9e #x66) as > "\x9e\x66" (equivalent to (concat "\x9e" "\x66") which is correct) > instead of as "\x9ef" (equivalent to "\N{BENGALI DIGIT NINE}" which is > wrong). > > This fixes the problem and doesn't introduce new syntax. You want to quote all %c as if they were raw bytes? Or only following a raw byte? And what about (format "%cf" #x9e) which was the originally reported issue? In any case, this would definitely be a regression, because it creates very confusing displayed strings. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no