URL encoding: Difference between revisions

Content deleted Content added
added objective-c
added ruby
Line 168:
s = urllib.quote(s)</lang>
There is also <code>urllib.quote_plus()</code>, which also encodes spaces as "+" signs
 
=={{header|Ruby}}==
 
<lang ruby>require 'uri'
 
normal = "http://foo bar/"
encoded = URI.escape(normal, Regexp.new("[^#{URI::PATTERN::UNRESERVED}]"))
puts encoded # prints "http%3A%2F%2Ffoo%20bar%2F"</lang>
 
=={{header|Tcl}}==