<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def set_str_param(params, name, value):
 """ Set a string parameter if applicable. :param dict params: A dict containing API call parameters. :param str name: The name of the parameter to set. :param value: The value of the parameter. If ``None``, the field will not be set. If an instance of ``str``, the relevant field will be set. If an instance of ``unicode``, the relevant field will be set to the UTF-8 encoding. Any other value will raise a `ValueError`. :returns: ``None`` """

    if value is None:
        return

    if isinstance(value, str):
        params[name] = value
    elif isinstance(value, unicode):
        params[name] = value.encode('utf-8')
    else:
        raise ValueError("Parameter '%s' must be a string or None, got %r." % (
            name, value))