URL escaping would be like "www.fred.com/this file" => "www.fred.com/this%20file"
If you just want to replace known entities for HTML, you could use sed:
echo "<b>This is some text</b>" | sed "s/</\</g;s/>/\>/g"
but obviously you need to extend it for whatever other entities you need to include (&, "). If you just want to avoid finding all the entities, there's an awk script here
that should do what you've described.