Having an issue.. Need ASCII URL

So I am trying to make one of my plugins work with another website... However the URL that is being outputted is appearing as normal (ex: http://google.com)

However the website I am trying to get it to work with needs the url to be ASCII (I think that's what it's called)?

It has to look like http%3A%2F%2Fgoogle.com instead of http://google.com

Anyone know of how to change it to this? Or a plugin that does? The information that needs to be converted is outputted using <?php ?>