Ejemplo n.º 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
Ejemplo n.º 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
Ejemplo n.º 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
Ejemplo n.º 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
Ejemplo n.º 5
0
Archivo: text.py Proyecto: 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
Ejemplo n.º 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