Best Way to encode a URL

I’d like to encode parameters so they can properly be passed in a URL. What is the best way to do this?

I tried the following, but I received a thread error.

url = CreateObject(“roUrlTransfer”)
sURLEncoded = url.Escape(urlToEncode)

Is there a different way to do this so I don’t get a thread error?

Try this workaround i whipped: viewtopic.php?f=34&t=96379#p538882
Read the whole thread re discussion.