[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#48324: 27.2; hexl-mode duplicates the UTF-8 BOM
From: |
Eli Zaretskii |
Subject: |
bug#48324: 27.2; hexl-mode duplicates the UTF-8 BOM |
Date: |
Mon, 10 May 2021 17:17:49 +0300 |
> Date: Sun, 9 May 2021 23:38:18 +0200
> From: "R. Diez" via "Bug reports for GNU Emacs,
> the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
>
> I think that hexl-mode has problems with the UTF-8 BOM byte sequence at the
> beginning of a text file. The steps to reproduce this issue are:
>
> Create a text file with a single line with 3 characters: 123
>
> Do a (set-buffer-file-coding-system 'utf-8-with-signature-dos) and save the
> file.
>
> The file should now have the following contents (8 bytes):
>
> ef bb bf 31 32 33 0d 0a
>
> That is the UTF-8 BOM (ef bb bf), the ASCII digits 1, 2 and 3, and
> end-of-line sequence (CR LF).
>
> Now change to hexl-mode, place the cursor at the '1' character (31 in hex),
> call hexl-insert-hex-char, and enter 00 in order to replace the '1' with a
> binary zero (NUL character).
>
> The result is puzzling. Instead of replacing the '1' (31) with NUL (00), the
> UTF-8 BOM is duplicated, the characters '1' and '2' and '3' have been
> overwritten with the new copy of BOM, character CR has been replaced with
> NUL, and character LF is intact:
>
> ef bb bf ef bb bf 00 0a
>
> If you save, close and reload the file, it gains one byte, but that is
> probably not important, just a consequence of having lost the CR character:
>
> ef bb bf ef bb bf 00 0d 0a
I cannot reproduce this. Are you sure you are using hexl executable
which came with Emacs 27.2 and not some older/incompatible version?
Are you sure your hexl.el is the one which came with Emacs 27.2?
And on what OS is this (you have omitted all the information collected
by report-emacs-bug, so I cannot know that)?
Thanks.
- bug#48321: 27.2; Text copied from *grep* buffer has NUL (0x00) characters, R. Diez, 2021/05/09
- bug#48324: 27.2; hexl-mode duplicates the UTF-8 BOM, R. Diez, 2021/05/09
- bug#48324: 27.2; hexl-mode duplicates the UTF-8 BOM,
Eli Zaretskii <=
- Message not available
- bug#48324: 27.2; hexl-mode duplicates the UTF-8 BOM, Eli Zaretskii, 2021/05/10
- bug#48324: 27.2; hexl-mode duplicates the UTF-8 BOM, Lars Ingebrigtsen, 2021/05/10
- bug#48324: 27.2; hexl-mode duplicates the UTF-8 BOM, Andreas Schwab, 2021/05/10
- bug#48324: 27.2; hexl-mode duplicates the UTF-8 BOM, Eli Zaretskii, 2021/05/10
- bug#48324: 27.2; hexl-mode duplicates the UTF-8 BOM, R. Diez, 2021/05/10
- bug#48324: 27.2; hexl-mode duplicates the UTF-8 BOM, Eli Zaretskii, 2021/05/10
- bug#48324: 27.2; hexl-mode duplicates the UTF-8 BOM, Andreas Schwab, 2021/05/10
- bug#48324: 27.2; hexl-mode duplicates the UTF-8 BOM, Eli Zaretskii, 2021/05/11
- bug#48324: 27.2; hexl-mode duplicates the UTF-8 BOM, Glenn Morris, 2021/05/11
- bug#48324: 27.2; hexl-mode duplicates the UTF-8 BOM, Eli Zaretskii, 2021/05/12