Пример #1
0
def encodeValue(value):
    string_org = value
    try:
        value = smart_unicode(value)
    except (UnicodeEncodeError, DjangoUnicodeDecodeError):
        value = smart_str(value)
    except Exception:
        value = string_org
    return value
Пример #2
0
def encodeValue(value):
    string_org = value
    try:
        value = smart_unicode(value)
    except (UnicodeEncodeError, DjangoUnicodeDecodeError):
        value = smart_str(value)
    except:
        value = string_org
    return value
Пример #3
0
def encodeValue(string):
    string_org = string
    try:
        string = smart_unicode(string)
    except (UnicodeEncodeError, DjangoUnicodeDecodeError):
        string = smart_str(string)
    except:
        string = string_org
    return string
Пример #4
0
def encodeValue(string):
    string_org = string
    try:
        string = smart_unicode(string)
    except (UnicodeEncodeError, DjangoUnicodeDecodeError):
        string = smart_str(string)
    except:
        string = string_org
    return string
Пример #5
0
def encodeValue(value):
    string_org = value
    try:
        value = smart_unicode(value)
    except (UnicodeEncodeError):
        value = smart_str(value)
    except:
        value = string_org
    return value
Пример #6
0
def encodeValue(value):
    string_org = value
    try:
        value = smart_unicode(value)
    except UnicodeEncodeError as e:
        print("goose.text.encodeValue.UnicodeEncodeError: ", e)
        value = smart_str(value)
    except DjangoUnicodeDecodeError as e:
        print("goose.text.encodeValue.DjangoUnicodeDecodeError: ", e)
        value = smart_str(value)
    except Exception as e:
        print("goose.text.encodeValue.Exception: ", e)
        value = string_org
    return value