def prepareStringArgument(self, stringToPrepare):
    ' Internal processing function '
    if (stringToPrepare == None):
        return None
    if (type(stringToPrepare) == str):
        return stringToPrepare.encode('utf-8')
    elif (type(stringToPrepare) == bytearray):
        return stringToPrepare.decode().encode('utf-8')
    elif (type(stringToPrepare) == bytes):
        return str(stringToPrepare).encode('utf-8')
    return stringToPrepare
Internal processing function
def prepareStringArgument(self, stringToPrepare):
    '  '
    if (stringToPrepare == None):
        return None
    if (type(stringToPrepare) == str):
        return stringToPrepare.encode('utf-8')
    elif (type(stringToPrepare) == bytearray):
        return stringToPrepare.decode().encode('utf-8')
    elif (type(stringToPrepare) == bytes):
        return str(stringToPrepare).encode('utf-8')
    return stringToPrepare