Maintenance Ruby 3.3 gets fixes, but no new features. Switch to Ruby 4.0 →
class method
URI.encode_uri_component
encode_uri_component(str, enc=nil)
lib/uri/common.rb
View on GitHub ↗
# File tmp/rubies/ruby-3.3.0/lib/uri/common.rb, line 374
def self.encode_uri_component(str, enc=nil)
_encode_uri_component(/[^*\-.0-9A-Z_a-z]/, TBLENCURICOMP_, str, enc)
end
Like URI.encode_www_form_component, except that ' ' (space) is encoded as '%20' (instead of '+').
See also
._encode_uri_component
.encode_www_form
.decode_www_form_component
.encode_www_form_component
also in
4.1 · 4.0 · 3.4 · 3.2