Hi,<br><br>I am havin an encoding problem. If you have read my earlier post, I was doing a simple chat application. Here is how it goes.<br><br>===<br>Client Class<br>===<br> def on_lineEdit_returnPressed(self):<br> text= self.ui.lineEdit.text()<br>
self.ui.lineEdit.selectAll()<br> self.ui.lineEdit.cut()<br> self.ui.textEdit.paste()<br> self.netconnector.sendMessage(text)<br><br>===<br>netconnector<br>===<br><br> def sendMessage(self,msg):<br>
if self.isConnected:<br> self.socket.send(msg.toUtf8().trimmed())<br>===<br>Server Side:<br>===<br><br>===<br>Server Class<br>===<br>self.connect(self.netconnector,QtCore.SIGNAL("dataRecieved(QString)"),self.messageRecieved)<br>
<br>===<br>server side netconnector:<br>===<br><br> def messageRecieved(self,data):<br> self.ui.textEdit.append(data)<br><br>What happens is that, when I type non-ascii characters into client side line edit, it becomes distorted at server side, like<br>
<br>þðü -- >
<style type="text/css">
p, li { white-space: pre-wrap; }</style>şğü<br><br>Any idea how to fix this?<br><br>You can find whole code as attachment.<br><br>