def _clean_win_chars(string):
    """Windows cannot encode some characters in filenames"""
    import urllib
    if hasattr(urllib, 'quote'):
        quote = urllib.quote
    else:
        quote = urllib.parse.quote
    for char in ('<', '>', '!', ':', '\\'):
        string = string.replace(char, quote(char))
    return string
