def receivePacket(self, data):
     self.log.debug("receivePacket %s", data)
         
     if self.pendingLongPoll:
         self.scheduleLongPoll(0)
     self.pendingLongPoll = False
     args = simplejson.loads(data, encoding = 'UTF-8')
     args = pokersite.fromutf8(args)
     packets = list(pokersite.args2packets(args))
     return packets
 def test_fromutf8(self):
     self.assertEqual(['b', {
         'a': 'c'
     }, ('d', ), 1], pokersite.fromutf8([u'b', {
         u'a': u'c'
     }, (u'd', ), 1]))
     self.assertEqual([u'b', {
         u'a': u'c'
     }, (u'd', ), 1], pokersite.toutf8(['b', {
         'a': 'c'
     }, ('d', ), 1]))
 def test_fromutf8(self):
       self.assertEqual(['b', {'a': 'c'}, ('d',), 1], pokersite.fromutf8([u'b', {u'a': u'c'}, (u'd',), 1]))
       self.assertEqual([u'b', {u'a': u'c'}, (u'd',), 1], pokersite.toutf8(['b', {'a': 'c'}, ('d',), 1]))