Question Reading decimal value of an extended ascii character

Alan Shore

New member
Joined
Sep 1, 2011
Messages
1
Programming Experience
Beginner
Hi,
I'm Alan and I'm writing a little program (beginner), but I'm stuck and I can't get any further. So I hope one of you guys can help me solve following problem.
Let me explain what I'm making, so it can give you all a better perspective.

For a this project I'm receiving data via the RS232 communication port. So basically I receive bytes. These bytes are converted to a string. So for example I receive this:
"BAA" this is good because I can get the correct decimal value for "B"(66) and "A"(65) using the command asc("A") in .NET.
but sometimes I receive a character that exceeds the 0-127 limit for example "ç"(128) (please see http://www.asciitable.com)
But now when I try to get the decimal value of "ç" I get 63 instead of 128. I searched the Internet and forums for an answer but I didn't find one that fits my problem.

So if it's possible, can one of you code experts explain me how to fix this problem ? It would help me a lot. I hope I described my problem clearly, but if there are some questions, please shoot.

Thanks,

Alan.
 
AscW and ChrW are the two-byte equivalents of Asc and Chr. If you are actually dealing with Unicode characters then it is preferred to use Convert.ToInt32 and Convert.ToChar.
 
Back
Top