Skip to content

Maintenance Ruby 3.4 gets fixes, but no new features. Switch to Ruby 4.0 →

class method

URI.encode_uri_component

(::String str, ?::encoding enc) -> ::String
encode_uri_component(str, enc=nil)

Like URI.encode_www_form_component, except that ' ' (space) is encoded as '%20' (instead of '+').