Earlier quoted context omitted.
So the character e.g. "B" would have this parity bit set and therefore should be filtered out and not count as a letter, in the ASCII world?
What in the hell are you going on about? B is 0x46 which is < 0x7F.
Exploring pre-1990 versions of wc(1) (2023)
21–27 of 27 posts
Re: Exploring pre-1990 versions of wc(1) (2023)
#22Earlier quoted context omitted.
ASCII is 7 bits (the eight bit would be parity), so that makes perfect sense, in an ASCII world.
So the character e.g. "B" would have this parity bit set and therefore should be filtered out and not count as a letter, in the ASCII world?
Re: Exploring pre-1990 versions of wc(1) (2023)
#23Earlier quoted context omitted.
What in the hell are you going on about? B is 0x46 which is < 0x7F.
I am going about the parity bit. 0x46 has odd number of bits set (three, to be precise) so for the parity to check out (that is, the number of bits set has to be even), a parity bit needs to be set and the resulting encoding has to be 0xC6, with four bits set.
Re: Exploring pre-1990 versions of wc(1) (2023)
#24Earlier quoted context omitted.
So the character e.g. "B" would have this parity bit set and therefore should be filtered out and not count as a letter, in the ASCII world?
Parity bits are not part of the character. They are for detecting transmission errors. You filter off the parity bit before looking at the byte.
Re: Exploring pre-1990 versions of wc(1) (2023)
#25Earlier quoted context omitted.
What in the hell are you going on about? B is 0x46 which is < 0x7F.
I am going about the parity bit. 0x46 has odd number of bits set (three, to be precise) so for the parity to check out (that is, the number of bits set has to be even), a parity bit needs to be set and the resulting encoding has to be 0xC6, with four bits set.
Re: Exploring pre-1990 versions of wc(1) (2023)
#26Earlier quoted context omitted.
Parity bits are not part of the character. They are for detecting transmission errors. You filter off the parity bit before looking at the byte.
But this is not what's the code doing, is it? It's not doing (ch & 0x7F), it's doing ch <= 0x7F. And the parity checking/filtering is done in the tape drive/serial port driver anyhow, it would never reach wc in the first place.
Re: Exploring pre-1990 versions of wc(1) (2023)
#27Earlier quoted context omitted.
What in the hell are you going on about? B is 0x46 which is < 0x7F.
I am going about the parity bit. 0x46 has odd number of bits set (three, to be precise) so for the parity to check out (that is, the number of bits set has to be even), a parity bit needs to be set and the resulting encoding has to be 0xC6, with four bits set.