def encode(self, string):
        if isinstance(string, unicode):
            string = string.encode(self.encoding)
        return string
If C{string} is a C{unicode} object, encode it using this
dataset/ETHPy150Open sassoftware/conary/conary/dbstore/base_drv.py/BaseCursor.encode