I need to convert a string to 7-bit ASCII with even parity in a C# application which communicates with a mainframe. I tried using Encoding.ASCII, however, it does not have the correct parity.
I need to convert a string to 7-bit ASCII with even parity in a
Share
Perhaps something like this:
Completely untested. Don’t ask me how the magic to compute parity works. I just found it here. But some variant of this should do what you want.
I tried to make this work for the case
','becoming 0x82. But I can’t work out how that is supposed to be done.','is, in ASCII, binary 00101100 and 0x82 is binary 10000010. I don’t see the correlation at all.