[Top][All Lists]

[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 20:39:48 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu)

>> This is because 4194176 is printed as ?\200 that is parsed as 128.
>> This patch should fix test failures by printing integers
>> for ambiguous characters.  I'm sure no user would complain
>> that numbers between 4194176 and 4194303 are printed as integers.
>>      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.

> To produce 4194176 from ?\200, one way is this:
>   (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.  Thus 'print' should print '(33 4194176) as such ugly code:
`(?! ,(decode-char 'eight-bit ?\200))

reply via email to

[Prev in Thread] Current Thread [Next in Thread]