Well 1. It didnt seem to work at all for me. //echo -a $urlencode(hmm testing;=!@#$%^&) returned: hmm testing;=!@#$%^&
And 2. If you do /urlencode 1 or any other number for that matter, it will give you an error. So I suggest you change the echo to echo -a.