GNU bug report logs - #27270
display-raw-bytes-as-hex generates ambiguous output for Emacs strings

Previous Next

Package: emacs;

Reported by: Paul Eggert <eggert <at> cs.ucla.edu>

Date: Wed, 7 Jun 2017 03:59:01 UTC

Severity: wishlist

Tags: moreinfo

Done: Paul Eggert <eggert <at> cs.ucla.edu>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: Eli Zaretskii <eliz <at> gnu.org>, v.schneidermann <at> gmail.com, 27270 <at> debbugs.gnu.org, npostavs <at> users.sourceforge.net
Subject: bug#27270: display-raw-bytes-as-hex generates ambiguous output for Emacs strings
Date: Sun, 24 Apr 2022 00:10:44 -0700
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.




This bug report was last modified 3 years and 109 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.