import gzip


def gunzip_string(zipped: bytes, encoding: str = "utf-8") -> str:
    """
    Reverses :func:`gzip_string`, i.e. un-gzip-compresses it, then decodes it
    into a string.

    Args:
        zipped:
            zipped data
        encoding:
            encoding that was used for the string prior to compression

    Returns:
        str: text

    Raises:
        - :exc:`OsError` if the data wasn't gzipped
        - :exc:`UnicodeDecodeError` if the decompressed data won't decode

    """
    data = gzip.decompress(zipped)
    return data.decode(encoding)