Hacker News new | ask | show | jobs
by epcoa 636 days ago
What in the hell are you going on about? B is 0x46 which is < 0x7F.
1 comments

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.
Assuming parity is enabled, the parity check is done at a lower level (serial port, TTY driver, etc.) and you'll never see it from the application. I used to mess around with serial ports and terminals a ton in my youth.
The parity bit is not part of the character. It's external, an error detecting device. To read ASCII you always look at bits 6..0, seven bits. You don't filter away the character because it has the parity bit set, you filter off the parity bit (whether it's set or not).