def smiles_to_folder_name(smiles):
    """
    Encodes the SMILES containing special characters as URL encoding.

    Parameters
    ----------
    smiles : str
        SMILES string describing a compound.

    Returns
    -------
    str :
        The standard URL encoding of the SMILES if it contains special characters.

    Notes
    -----
    : -> %3A
    \\ -> %5C (here backslash)
    / -> %2F
    * -> %2A

    Taken from:
    https://www.degraeve.com/reference/urlencoding.php
    """
    url_encoded_smiles = (
        smiles.replace(":", "%3A")
        .replace("\\", "%5C")
        .replace("/", "%2F")
        .replace("*", "%2A")
    )
    return url_encoded_smiles