This function provides a minimal encoding of a string in order to be used as part of a URL.
The object urlEncode is a method function.