Translate string to browser compliant url

Hi
I've an application where I have to take a file path and encode it into a URL string.
As well as having to change whitespace characters to '%20' I also need to deal with characters with diacritical marks àéïçÔ etc.
At the moment my plan is to use a regex replace to change each of these to it's ascii HEX code but this doesn't seem an efficient solution (looping through a hash of characters, testing each one).

Maybe there's a better way to do this?

Also, does anyone know the complete set of characters that one might find in a file path string that would need to be translated for use in a url (do I need to be concerned about {}[\\|/?# etc?
I do have the option to try something in Oracle (the source of the filenames) if that provides a cleaner solution that doing something in PP

Many thanks for any recommendation.

Tristan