class Async::HTTP::Reference

def escape(string)

Escapes a generic string, using percent encoding.
def escape(string)
	encoding = string.encoding
	string.b.gsub(/([^a-zA-Z0-9_.\-]+)/) do |m|
		'%' + m.unpack('H2' * m.bytesize).join('%').upcase
	end.force_encoding(encoding)
end