def validate_str(obj):
    """
    Check that obj is a string and then convert it to unicode.

    Parameters
    ----------
    obj: Any
        Object that should be a string

    Returns
    -------
    str
        `obj` as a string.

    Raises
    -------
    ValueError
        If `obj` is not a string.

    """
    if not isinstance(obj, str):
        raise TypeError('Expected a string but got {} instead'.format(type(
            obj)))
    try:
        return obj.decode('utf-8')
    except AttributeError:
        return obj
