I am trying to build an ios application with python and monngodb at backend. I am using twisted library to create sockets connection. The server seems to recieve the data when it consists only the ascii characters but when string contains non-ASCII characters such as 'å' 'ö' 'ä', nothing happens in the server. The dataRecieved method is not triggered at all.
this is my testing code:
from twisted.internet.protocol import Factory, Protocol
from twisted.internet import reactor
class Test(Protocol):
def connectionMade(self):
self.factory.clients.append(self)
print "clients are ", self.factory.clients
def connectionLost(self, reason):
self.factory.clients.remove(self)
print "clients are removed"
def dataReceived(self, data):
print data
factory = Factory()
factory.clients = []
factory.protocol = Test
reactor.listenTCP(80, factory)
print "server started"
reactor.run()