Prolog function for creating a safe file name from a source string?

I’m using: SWI-Prolog version 8.0.2.

Is there an SWI-Prolog built-in function that can take a string return a string that is known to be safe for the current O/S? Something that will delete or translate unsafe characters to safe ones so the source string can then be used as the name of a local file without triggering an exception from the O/S? For example, on Windows you can’t have question marks, colons, etc.

No. It is not that hard to write, I guess. Alternatively, use base64url.

2 Likes

Ah, good idea using base64url, thanks!