예제 #1
0
    def testConstruction(self):
        """QTextStream construction"""
        obj = QTextStream()

        self.assertEqual(obj.codec(), QTextCodec.codecForLocale())
        self.assertEqual(obj.device(), None)
        self.assertEqual(obj.string(), None)

        self.assertTrue(obj.atEnd())
        self.assertEqual(obj.readAll(), "")
예제 #2
0
    def testConstruction(self):
        '''QTextStream construction'''
        obj = QTextStream()

        self.assertEqual(obj.codec(), QTextCodec.codecForLocale())
        self.assertEqual(obj.device(), None)
        self.assertEqual(obj.string(), None)

        self.assertTrue(obj.atEnd())
        self.assertEqual(obj.readAll(), '')
예제 #3
0
def qu(s):
    """
  @param  s  str or bytearray or None
  @return  unicode or u""
  """
    global _Q_D0
    if not _Q_D0:
        global _Q_C0
        from PySide.QtCore import QTextCodec
        _Q_C0 = QTextCodec.codecForLocale()
        _Q_D0 = _Q_C0.makeDecoder()
    return _Q_D0.toUnicode(s) if s else u""