[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#27270: display-raw-bytes-as-hex generates ambiguous output for Emacs
From: |
Lars Ingebrigtsen |
Subject: |
bug#27270: display-raw-bytes-as-hex generates ambiguous output for Emacs strings |
Date: |
Sun, 24 Apr 2022 13:24:53 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) |
Paul Eggert <eggert@cs.ucla.edu> 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
bug#27270: display-raw-bytes-as-hex generates ambiguous output for Emacs strings,
Lars Ingebrigtsen <=
- bug#27270: display-raw-bytes-as-hex generates ambiguous output for Emacs strings, Paul Eggert, 2022/04/24
- bug#27270: display-raw-bytes-as-hex generates ambiguous output for Emacs strings, Lars Ingebrigtsen, 2022/04/25
- bug#27270: display-raw-bytes-as-hex generates ambiguous output for Emacs strings, Paul Eggert, 2022/04/25
- bug#27270: display-raw-bytes-as-hex generates ambiguous output for Emacs strings, Lars Ingebrigtsen, 2022/04/26
- bug#27270: display-raw-bytes-as-hex generates ambiguous output for Emacs strings, Paul Eggert, 2022/04/26
- bug#27270: display-raw-bytes-as-hex generates ambiguous output for Emacs strings, Lars Ingebrigtsen, 2022/04/27
- bug#27270: display-raw-bytes-as-hex generates ambiguous output for Emacs strings, Paul Eggert, 2022/04/27
- bug#27270: display-raw-bytes-as-hex generates ambiguous output for Emacs strings, Lars Ingebrigtsen, 2022/04/27
- bug#27270: display-raw-bytes-as-hex generates ambiguous output for Emacs strings, Paul Eggert, 2022/04/28