def fix_international(text):
    "Fix excaped international characters back to utf-8"
    class SmartInternational(str):
        def __new__(cls, text):
            return str.__new__(cls, text)
        def endswith(self, string):
            return super(SmartInternational, self).endswith(str(string))
    if six.PY3:
        return text
    out = []
    last = 0
    for match in re.finditer(r'(?<=[^\\])(?:\\x[0-9a-f]{2}|\\u[0-9a-f]{4})', text):
        start, end, group = match.start(), match.end(), match.group()
        out.append(text[last:start])
        c = group.decode('unicode_escape')
        out.append(c if 160 > ord(c) and ord(c) != 173 else group)
        last = end
    out.append(text[last:])
    return SmartInternational(''.join(out).encode('utf-8'))
dataset/ETHPy150Open django-salesforce/django-salesforce/salesforce/management/commands/inspectdb.py/fix_international/swapped operands of `>`