'Set properties and text of this info from a dictionary.'

def setProperties(self, properties):

    if isinstance(properties, dict):
        self.properties = properties
        list = []
        result = ''
        for key in properties:
            value = properties[key]
            if (value is None):
                suffix = ''.encode('utf-8')
            elif isinstance(value, str):
                suffix = value.encode('utf-8')
            elif isinstance(value, int):
                if value:
                    suffix = 'true'
                else:
                    suffix = 'false'
            else:
                suffix = ''.encode('utf-8')
            list.append('='.join((key, suffix)))
        for item in list:
            result = ''.join((result, chr(len(item)), item))
        self.text = result
    else:
        self.text = properties
