#437945 ascii: prints weird results for non-ascii chars

Package:
ascii
Source:
ascii
Description:
interactive ASCII name and synonym chart
Submitter:
Paolo
Date:
2022-06-16 10:27:07 UTC
Severity:
minor
Tags:
#437945#5
Date:
2007-08-14 21:38:38 UTC
From:
To:
test case:

$ ascii à ('a' with accent, in case it gets mangled by SMTP)
ASCII -2/0 is decimal -32, hex ffffffe0, octal 37777777740, bits 00100000: meta-`
ok, 'à' ('a' with accent) isn't ASCII; then ascii should just say so, not
print such funny numbers.

thanks
--
paolo

#437945#10
Date:
2007-09-14 09:09:36 UTC
From:
To:
Hello Paolo,

thanks for your bugreport, and sorry for the long delay in answering.

Hmm, that's strange. Say, this only occurs on the system console and not
under X, right? At least that's the only place where I could reproduce
it ...

Cheers,
Flo

#437945#15
Date:
2007-09-14 14:51:12 UTC
From:
To:
no, that's in xterm. But on console I get same result-
#437945#20
Date:
2008-02-17 00:12:26 UTC
From:
To:
This is harder to reproduce in a UTF-8 locale because multibyte
characters do not exhibit this problem.  Try this:

$ ascii $(printf '\xff')
ASCII 0/-1 is decimal -01, hex ffffffff, octal 37777777777, bits
00000001: meta-^_

#437945#23
Date:
2008-02-24 12:56:37 UTC
From:
To:
Hello again,

there's another bugreport in the Debian BTS I haven't forwarded yet,
please see <http://bugs.debian.org/437945>.

For the sake of completeness, please find attached the full debdiff of
the current Debian package as it applies to your upstream work: some
nametable fixes and simplified ascii.xml to make Debian xmlto actually
build the manpage.

Cheers,
Flo

#437945#28
Date:
2008-02-26 06:30:12 UTC
From:
To:
Florian Ernst <florian_ernst@gmx.net>:

I see it.  But I don't know what code point that á is generating,
which makes troubleshooting it a bit difficult.

These look equivalent to a set of markup fixes I already have.
They'll be in 3.9.

#437945#35
Date:
2018-06-11 10:50:17 UTC
From:
To:
On system with signed char, ascii would incorrectly handle bytes with the
highest bit set.

Before:

    $ ascii $(printf '\xff')
    ASCII 268435455/15 is decimal 4294967295, hex ffffffff, octal 37777777777, bits 11111111: meta-^_

After:

    $ ascii $(printf '\xff')
    ASCII 15/15 is decimal 255, hex ff, octal 377, bits 11111111: meta-^?

Fixes: https://bugs.debian.org/437945
---
 ascii.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ascii.c b/ascii.c
index 4ad7d5b..8a6ff4d 100644
--- a/ascii.c
+++ b/ascii.c
@@ -224,7 +224,7 @@ static void ascii(char *str)

     /* interpret single characters as themselves */
     if (len == 1) {
-	speak((unsigned int)str[0]);
+	speak((unsigned char)str[0]);
 	/* also interpret single digits as numeric */
 	if(!line && strchr("0123456789ABCDEFabcdef",str[0])) {
 	    int hval;

#437945#42
Date:
2022-06-16 10:16:02 UTC
From:
To: