Do not blacklist eg dot.
mimeopen passes wrong filename to the editor/viewer when filename contains '#'. So mask this (replace _) and some other non-alpha-numeric characters.