I'm using DataFlex Reports 7.0 with a DataFlex 19.1 web application. I've been testing a way to let users change the report title from the Export report dialog. Once they type a new title and proceed to generate the report, the report will be generated and the text shown on the page header section will be that custom text. Everything is working fine there. Also, it works out of the box with every report we have already done without any modifications.

Then I decided to improve it a bit. I created a function to generate a filename. It cleans the string from spaces, it adds the current date at the end and so on.
For example, if the user defines " My report " as the report title, the output will be the file "My-report-22-07-2020_12-30.pdf". And this is working almost fine.

The issues begin when the custom title contains special characters such as "ç", "á", "é", ":",... Some of them will make the report generation fail (file not found due to incorrect paths) and others will be generated but the file won't be send to the client (it is created and it can be opened from the "Reports" folder, but when downloaded on the WebApplication, it will be corrupt and show no data).
I know the easiest solution here would be to set an UUID or a static name for the file and the problem would be solved. But I would like to know whether is there any built in function to "clean" a given string from those special characters so that it doesn't cause pathing issues. Another solution might be using some regex to do this and allow only alphanumeric values on the filename, but I haven't done it yet with DataFlex (Is it possible?).

Tell me what would you do and what do you think about allowing this kind of personalization on reports