From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Paul Eggert Newsgroups: gmane.emacs.bugs Subject: bug#27270: display-raw-bytes-as-hex generates ambiguous output for Emacs strings Date: Sun, 24 Apr 2022 00:10:44 -0700 Organization: UCLA Computer Science Department Message-ID: 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; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="24039"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Cc: v.schneidermann@gmail.com, 27270@debbugs.gnu.org, npostavs@users.sourceforge.net To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Apr 24 09:11:50 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 1niWPO-00068s-IQ for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 24 Apr 2022 09:11:50 +0200 Original-Received: from localhost ([::1]:34258 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1niWPN-0007m7-4j for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 24 Apr 2022 03:11:49 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:38550) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1niWOc-0007lr-BN for bug-gnu-emacs@gnu.org; Sun, 24 Apr 2022 03:11:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:35439) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1niWOc-0000xY-39 for bug-gnu-emacs@gnu.org; Sun, 24 Apr 2022 03:11:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1niWOb-0005l0-Sj for bug-gnu-emacs@gnu.org; Sun, 24 Apr 2022 03:11:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Paul Eggert Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 24 Apr 2022 07:11:01 +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.165078425422118 (code B ref 27270); Sun, 24 Apr 2022 07:11:01 +0000 Original-Received: (at 27270) by debbugs.gnu.org; 24 Apr 2022 07:10:54 +0000 Original-Received: from localhost ([127.0.0.1]:57569 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1niWOU-0005kf-HY for submit@debbugs.gnu.org; Sun, 24 Apr 2022 03:10:54 -0400 Original-Received: from zimbra.cs.ucla.edu ([131.179.128.68]:50402) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1niWOR-0005kO-CT for 27270@debbugs.gnu.org; Sun, 24 Apr 2022 03:10:53 -0400 Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id E815716009A; Sun, 24 Apr 2022 00:10:45 -0700 (PDT) Original-Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id OUxZj7qBx8qk; Sun, 24 Apr 2022 00:10:45 -0700 (PDT) Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 380AB1600C5; Sun, 24 Apr 2022 00:10:45 -0700 (PDT) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Original-Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id 8eQeTYZK6w-q; Sun, 24 Apr 2022 00:10:45 -0700 (PDT) Original-Received: from [192.168.1.9] (cpe-172-91-119-151.socal.res.rr.com [172.91.119.151]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id ED60316009A; Sun, 24 Apr 2022 00:10:44 -0700 (PDT) Content-Language: en-US In-Reply-To: <87k0bfsxvk.fsf@gnus.org> 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:230537 Archived-At: On 4/23/22 07:00, Lars Ingebrigtsen wrote: > we've had this format for half a decade now, and this doesn't > really seem to be a problem in practice 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 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.