[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#44155: Print integers as characters
From: |
Juri Linkov |
Subject: |
bug#44155: Print integers as characters |
Date: |
Sun, 01 Nov 2020 21:13:03 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu) |
>> >> if (EQ (Vinteger_output_format, Qt) && CHARACTERP (obj)
>> >> - && (c = XFIXNUM (obj)))
>> >> + && (c = XFIXNUM (obj)) && ! CHAR_BYTE8_P (c))
>> >
>> > If a test fails, it is better to fix the test and not make the code
>> > less powerful, don't you agree?
>>
>> This means sweeping the problems under the carpet.
>
> Which problem?
Problem of ambiguous numbers 128 and 4194176 that are both printed as ?\200.
>> > (decode-char 'eight-bit ?\200)
>> >
>> > Can't this be used in the test?
>>
>> Using this code in tests means that the users should use the same code
>> in their programs.
>
> Why would they need to do that? The test needs it because it wants to
> verify the result, but "normal" programs don't need to read back the
> values they printed.
Programs print the lists of characters, and other programs read them.
>> Thus 'print' should print '(33 4194176) as such ugly code:
>> `(?! ,(decode-char 'eight-bit ?\200))
>
> I don't see why. ?\200 and 4194176 are two forms of the same
> character.
?\200 and 128 are two forms of the same character too.
- bug#44155: Print integers as characters, Mattias Engdegård, 2020/11/01
- bug#44155: Print integers as characters, Juri Linkov, 2020/11/01
- bug#44155: Print integers as characters, Mattias Engdegård, 2020/11/01
- bug#44155: Print integers as characters, Juri Linkov, 2020/11/02
- bug#44155: Print integers as characters, Mattias Engdegård, 2020/11/02
- bug#44155: Print integers as characters, Juri Linkov, 2020/11/03
- bug#44155: Print integers as characters, Eli Zaretskii, 2020/11/03
- bug#44155: Print integers as characters, Mattias Engdegård, 2020/11/03