Converting ASCII code extended to character

0

I have a program in VB.Net that reads from the serial port the characters that come to it:

serialPort = My.Computer.Ports.OpenSerialPort(leerPuerto())
serialPort.BaudRate = 9600
serialPort.Parity = IO.Ports.Parity.None
serialPort.StopBits = IO.Ports.StopBits.One
serialPort.DataBits = 8
serialPort.Handshake = IO.Ports.Handshake.None
serialPort.Encoding = Encoding.GetEncoding(28591)
caracter = serialPort.ReadChar

I see that he misinterprets the characters and he returns the following: ¶3fÌ27 I know he is trying to return the value 0.0027 but he is not able to transform the first character into a negative or positive symbol.

On the other hand, if I read the byte from the serial port and return it to char using the expanded ascii table, we see that number 43 corresponds:

How can I convert the code 43 to the corresponding character in that table?

    
asked by marcss 03.10.2018 в 17:51
source

0 answers