dossier/store/store.py
def safe_lower_utf8(x):
    '''x.lower().encode('utf-8') where x can be None, str, or unicode'''
    if x is None:
        return None
    x = x.lower()
    if isinstance(x, unicode):
        return x.encode('utf-8')
    return x
def safe_lower_utf8(x):
    '''x.lower().encode('utf-8') where x can be None, str, or unicode'''
    if x is None:
        return None
    x = x.lower()
    if isinstance(x, unicode):
        return x.encode('utf-8')
    return x
x.lower().encode('utf-8') where x can be None, str, or unicode