def easy_encode(value, enc_type='utf-8', errors='strict'):
    """ Try to .encode(enc_type) on value.
    """
    try:
        return value.encode(enc_type, errors)
    except AttributeError:
        return value
