Background: Windows Server 2003 R2,Wire Service virtual serial port created with RealPort software, Serial Port configured as COM5, 9600 baud,8 data bits, no parity bits, 1 stop bit, no flow control, Using RXTX 2.1-7.
The port COM5 is found, the serial port is created using the portId.open method and port parameters and flow control are set to match the device driver settings above. I get the serialPort IntupStream and wrap it in an InputStreamReader so I can control the input encoding. The default encoding is of course Cp1252 I've read that if you are using 8 data bits the encoding should be ISO-8859-1 aka Latin1. and am using the InputStreamReader method: int c = isr.read(); in a while loop in the case SerialPort.Event.DATA_AVAILABLE Printing out the integer c and it's cast to a character ((char)c); The problem is that the numbers and resulting characters are shifted too high (range is 135 - 250) The messages all end with "All Rights Reserved.)" and the last characters in each message are the same. However, the shift is not consistent from character to character. Have tried other encodings: UTF8/UTF-8 shift the numbers even higher. as does ascii/us-ascii. Cp1252 shifts the numbers to the 130 - 350 range except for 3 characters which are shifted to 65533, 8222 and 8240. Note: using the InputStreamReader.getEncoding() UTF8 and UTF-8 are UTF8 and ascii and us-ascii are ASCII.
Are there other encodings I should try? Anyone else seen this sort of thing?