def encodeInfoValue(val):
    """
    Return text where special characters was escaped. This method is used to write values coming from INFO or FORMAT.

    :param val: A string value of an item of INFO or FORMAT.
    :type val: str
    :return: Text where special characters was escaped (:, ;, =, ,).
    :rtype: str
    """
    return val.replace(':', '%3A').replace(';', '%3B').replace('=', '%3D'
        ).replace(',', '%2C')
