def sval(val):
    """
    Returns a string value for the given object.  When the object is an instanceof bytes,
    utf-8 decoding is used.

    Parameters
    ----------
    val : object
        The object to convert

    Returns
    -------
    string
        The input value converted (if needed) to a string
    """
    if isinstance(val, bytes):
        return str(val, 'utf-8')
    else:
        return str(val)