Example #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
Example #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
Example #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
Example #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
Example #5
0
File: text.py Project: c24b/crawax
def encodeValue(value):
    string_org = value
    try:
        value = smart_unicode(value)
    except (UnicodeEncodeError):
        value = smart_str(value)
    except:
        value = string_org
    return value
Example #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