def encode(name, system='<STR_LIT>'):
assert system == '<STR_LIT>', '<STR_LIT>'<EOL>special_characters = r'<STR_LIT>' + '<STR_LIT>'.join(map(chr, range(<NUM_LIT:32>)))<EOL>pattern = '<STR_LIT:|>'.join(map(re.escape, special_characters))<EOL>pattern = re.compile(pattern)<EOL>return pattern.sub('<STR_LIT:_>', name)<EOL>
Encode the name for a suitable name in the given filesystem
>>> encode('Test :1')
'Test _1'