'Convert ASCII, Latin-1 or UTF-8 to pure Unicode'

def encode_string(self, value):

    if (not isinstance(value, str)):
        return value
    try:
        return six.text_type(value, 'utf-8')
    except:
        arr = []
        for ch in value:
            arr.append(six.unichr(ord(ch)))
        return u''.join(arr)
