Converting text special characters

Hi-

I’m trying to call a URL with a variable. I’m loading text into the variable, but need to convert the text into a format acceptable for yahoo maps…

So I need to convert spaces to +, etc. Is there a simple way to do this? Or a way to convert normal text with spaces and other characters into a format that yahoo or google maps will recognize?

thanks in advance.