def parse_params(param_str):
    """
    Convert a string of the form name='value', ... into a dictionary.  Leading
    and trailing spaces are stripped, as are line-feed, carriage-return, tab,
    single-quote and double-quote characters.
    """
    params = {}
    for param in param_str.split(','):
        dirty = param.split('=')
        key = dirty[0].strip(' \t\n\r\'\"')
        value = dirty[1].strip(' \t\n\r\'\"')
        params.update({key: value})

    return params