title: Character encoding problem with QextSerialPort (Qt/C++)
body: <p>I am developing a Qt/C++ programme in QtCreator that reads and writes from/to the serial port using QextSerialPort. My programme sends commands to a Rhino Mark IV controller and must read the response of those commands (just in case they produce any response). My development and deployment platform is Windows XP Professional.</p>
  
  <p>When the Mark IV sends a response to a command and my programme reads that response from the serial port buffer, the data are not properly encoded; my programme does not seem to get plain ASCII data. For example, <strong>when the Mark IV sends an ASCII "0" (decimal 48) followed by a carriage return (decimal 13), my buffer (<code>char *</code>) gets -80 and 13. Characters are not properly encoded, but carriage returns are indeed.</strong> I have tried using both <code>read (char *data, qint64 maxSize)</code> and <code>readAll ()</code>.</p>
  
  <p><strong>I have been monitoring the serial port traffic</strong> using two monitors that interpret ASCII data and display the corresponding characters, <strong>and the data sent in both ways seem to be correctly encoded</strong> (they are actually displayed correctly). Given that <code>QByteArray</code> does not interpret any character encoding and that I have tried using both <code>read (char *data, qint64 maxSize)</code> and <code>readAll ()</code>, I have discarded that the problem may be caused by Qt. However, I am not sure if the problem is caused by QextSerialPort, because my programme send (writes) data properly, but does not read the correct bytes.</p>
  
  <p>I have also tried talking to the Mark IV controller by hand using HyperTerminal, and the communication takes place correctly, too. I set up the connection using HyperTerminal with the following parammeters:</p>
  
  <ul>
  <li>Baud rate: 9600</li>
  <li>Data bits: 8</li>
  <li>Parity bits: 0</li>
  <li>Stop bits: 1</li>
  <li>Flow control: Hardware</li>
  </ul>
  
  <p>My programme sets up the serial port using the same parammeters. HyperTerminal works, my programme does not.</p>
  
  <p>I started using QextSerialPort 1.1 from <a href="http://qextserialport.sourceforge.net/" rel="nofollow">qextserialport.sourceforge.net</a> and then tried with the latest source code from <a href="http://code.google.com/p/qextserialport/" rel="nofollow">QextSerialPort on Google Code</a>, and the problem remains.</p>
  
  <p><strong>What is causing the wrong character encoding?</strong></p>
  
  <p><strong>What do I have to do to solve this issue?</strong></p>