def fix_id(fid):
    """As a temporary measure, escapes certain special characters in a name.

       Right now, a measure like this is required to make Vega* work properly
       with various field names.

       See https://github.com/vega/vega-lite/issues/4965.
    """
    new_id = ''
    for c in fid:
        if c == '.':
            new_id += ':'
        elif c == ']':
            new_id += ')'
        elif c == '[':
            new_id += '('
        elif c == "'" or c == '"':
            pass
        elif c == '\\':
            new_id += '|'
        else:
            new_id += c
    return new_id
