Built-in Methods to Encode/Decode HTML?

You can do it with URI

name = "Ruby Programming Language"
url = "http://example.com/?name=" + URI.escape(name)
puts url # http://example.com/?name=Ruby%20Programming%20Language