I want to create a sane/safe filename (i.e. somewhat readable, no \"strange\" characters, etc.) from some random Unicode string (mich might contain just anything).
(
Python:
for c in r'[]/\;,><&*:%=+@!#^()|?^':
filename = filename.replace(c,'')
(just an example of characters you will want to remove)
The r in front of the string makes sure the string is interpreted in it's raw format, allowing you to remove backslash \ as well
Edit: regex solution in Python:
import re
re.sub(r'[]/\;,><&*:%=+@!#^()|?^', '', filename)