I
Iceman.Aragorn
I'm having an odd problem where im reading input from a comm port (the
maker of the software that exports the data TO the comm port is
unhelpful).
What im reading is fixed length (13 character) sets of data seperated
by CR/linefeed. At first, it simply seemed like i was getting messed
up data, due to encoding it wrong, or using the wrong font, or
something like that, but it turns out, when i analyze the byte stream,
that the data i get is, for example:
160 160 51 57 183 54 48 204 78 77 141 10
which would translate to (in terminal font) "àà39·60ÌNM?<LF>"
however, notice, if you subtract 128 from all the bytes larger than
127, you get
32 32 51 57 55 54 48 76 78 77 13 10
which would translate to " 39760LNM<CR><LF>"
which IS exactly the data we expect to get.
So, my question is,...does anyone know why in the world the data from
the commport (read using ReadByte()), would have various characters
offset by 128?
maker of the software that exports the data TO the comm port is
unhelpful).
What im reading is fixed length (13 character) sets of data seperated
by CR/linefeed. At first, it simply seemed like i was getting messed
up data, due to encoding it wrong, or using the wrong font, or
something like that, but it turns out, when i analyze the byte stream,
that the data i get is, for example:
160 160 51 57 183 54 48 204 78 77 141 10
which would translate to (in terminal font) "àà39·60ÌNM?<LF>"
however, notice, if you subtract 128 from all the bytes larger than
127, you get
32 32 51 57 55 54 48 76 78 77 13 10
which would translate to " 39760LNM<CR><LF>"
which IS exactly the data we expect to get.
So, my question is,...does anyone know why in the world the data from
the commport (read using ReadByte()), would have various characters
offset by 128?