def decode_text(value):
    """
        Decode a text-like value for display.

        Unicode values are returned unchanged. Byte strings will be decoded
        with a text-safe replacement for unrecognized characters.
    """
    if isinstance(value, bytes):
        return value.decode('ascii', 'replace')
    else:
        return value